**E85: Digital Electronics & Computer Engineering** *Fall 2018* - [Harvey Mudd College](http://www.hmc.edu) - [Department of Engineering](https://www.hmc.edu/engineering/) Prof. [R. Erik Spjut](http://erik.spjut.me), Prof. Yizhe (Izzy) Chang, Schedule ============= Item | Scheduled Time -----------------------------|---- Lecture: | MW 13:15-14:30; Shan B460 Lab: | Available 24/7 with combo; Parsons B183 ΤΒΠ Tutor Hours: | MT 18:30-20:30 Lab Proctor Hours: | F 14:00-16:00, Sat 12:00-16:00, 18:00-20:00, Sun 12:00-16:00 Prof. Spjut Office Hours: | T 18.30-21:00 Prof. Chang Office Hours: | T 7:50-10:50 Prof. Chang Lab Hours: | Sunday 14:00-18:00 Prof. Spjut's office is Parsons 2384 in the middle of the West hall on the top Floor of Parsons. Prof. Chang's office is Parsons 2364 close to the restrooms on the East hall on the top Floor of Parsons. Beyond our office hours, you can make appointments for other times as well. Also, feel free to just stop by whenever Prof. Spjut's office door is open and he's not already meeting with someone, even when it's not official office hours. He's usually here by 7 am and stays until at least 4 pm. Helping students understand what they're supposed to be learning is his job and he really enjoys it. The Lab Proctors, Graders, & ΤΒΠ Tutors for E85 are Name | Role | email address --------------------|-------------------------------|-------------- Veronica Cortes | ΤΒΠ Tutor/Proctor | vcortes@g.hmc.edu Laura Fleming | ΤΒΠ Tutor | Ryan Haughton | ΤΒΠ Tutor | Chris McElroy | ΤΒΠ Tutor | Aom Pongpiriyakarn | Head Proctor/Grader | apongpiriyakarn@g.hmc.edu Kai Kaneshina | Grader | kkaneshina@hmc.edu Rachel Perley | Grader | rperley@g.hmc.edu Siddharth Chandra | Proctor | schandra@g.hmc.edu Skipper Gonzalez | Proctor/Grader | sgonzalez@g.hmc.edu Teerapat Jenrungrot | Grader | mjenrungrot@hmc.edu Vicki Moran | Proctor | vmoran@hmc.edu Text ============ Harris & Harris, [*Digital Design and Computer Architecture, ARM Ed.*][txt], Morgan Kaufmann 2016. Link to [*Errata*][err] Here is Chapter 1 in case your book hasn't come yet: [DDCA ARMed Cpt 1](DSM/01_Ch_01.pdf) Electronic Communication =========== Class web page: [http://pages.hmc.edu/spjut/E85/index.md.html](index.md.html) Class email list: [eng-85-l@g.hmc.edu](eng-85-l@g.hmc.edu) You also will need a Harvey Mudd College computer to complete your labs. If you are not a HMC student, email me your full name and school affiliation and I will request an account for you. Course Objectives ========== Digital systems have revolutionized our world. From television to cell phones to GPS to warfare to medicine to automobiles, computers and digital processing have reshaped the way we live and work. Computers are also a vital part of daily practice in every field of science and engineering. Previous generations of engineers learned the "nuts and bolts" of the profession by doing things like disassembling and rebuilding engines. As technology has advanced, cars have become too complicated for the layperson to work on. Ironically, the same advances have made computers much easier to build. While most fields of engineering require extensive mathematics and complicated analysis of even rather simple components, digital systems merely require counting from 0 to 1. Their challenge, instead, is in combining many simple building blocks into a complex whole. Field programmable gate arrays (FPGAs), containing the equivalent of thousands or millions of logic gates, make it possible to build these complex systems in the lab without the tedium of manually connecting components. In this class, you will build your own microprocessor and test it on a FPGA. In the process, you will master the art and science of digital design. You will learn to speak to and control processors in their native tongue, assembly language. And you will put all the pieces together to demystify how a computer works. As you probably know, very few complex systems work the first time you put them together. Engineers must become good at systematically and efficiently debugging their creations. One of the course objectives that can be frustrating but vitally important is to learn to teach oneself professional-strength computer-aided design tools and to use these tools to debug systems. By the end of this course, a successful student will be able to: - Build digital systems at all levels of abstraction from transistors through circuits, logic, microarchitecture, architecture, and C culminating with implementing and programming a microprocessor soft core on a field programmable gate array. - Manage complexity using the digital abstraction, data types, static and dynamic disciplines, and hierarchical design. - Design and implement combinational and sequential digital circuits using schematics and hardware description languages. - Program a commercial microcontroller in C and assembly language and use it in a physical system. - Begin the practice of implementing and debugging digital systems with appropriate lab techniques including breadboarding, interpreting datasheets, and using field-programmable gate arrays and microcontroller boards, simulators, debuggers, and test-and-measurement equipment. Grading =============== | E85 | | E85A ---------------------|-----|----------------------|------ Labs: | 30% | Labs: | 30% Problem Sets: | 20% | Problem Sets: | 20% In-Class Activities: | 5% | In-Class Activities: | 5% Midterm: | 15% | Midterm: | 45% Final: | 30% Solutions to the labs and problem sets from previous semesters are undoubtedly floating around campus and on the web. You may **not** refer to solutions while doing the assignments; they must be your own work. Many of the labs build on previous labs. If you are sick or do not turn in a lab, you may refer to the solutions handed out to complete the lab when it is needed for a subsequent lab. However, you may not simply copy another student's files. Labs and homework are due by the end of class and *will not be graded* if submitted late. The *preferred* method to submit your labs and assignments is to submit hard copy. If you haven't had time to print out your hard copy, you may email me either a pdf or a Microsoft Word document and I will print it out and give it to the graders. Please only use sending me the soft copy as a last resort. Your lowest lab and problem set score will be dropped before the average is calculated. You are welcome to discuss labs and problem sets with other students or with the instructor or lab assistants or tutors **after** you have made an effort by yourself. However, you must turn in your own work, not work identical to that of another student. Be sure to credit at the top of your assignment anyone with whom you discussed ideas. **It is an honor code violation to simply copy someone else's work.** On a regular basis, there will be short in-class activities related to a recent lecture. You are strongly encouraged to come to regularly attend class, review your notes before class, and ask questions during class. If you stay on top of the material, you should have no difficulty doing well with these activities. The two lowest scores will be dropped. **Logisim** There are always a few students who stumble across [Logisim](http://www.cburch.com/logisim/) every semester. You may use Logisim for the following purposes 1. Drawing logic diagrams for homework or labs, but **not** for exams. 2. Double checking your homework and lab solutions but **not** exam solutions. All other uses related to E85 are forbidden. **It is an honor code violation to us Logisim on an exam for any purpose.** That said, once you're out of E85, you will probably never work on E85-style problems by hand again, and Logisim is a really good way to solve reasonably small ones. Class Calendar ================== The reading is due by the start of the class for which it is assigned. *The calendar will be updated regularly*. Please check back often. Wednesday 05 SEP 2018: Introduction: - Introduction: - digital abstraction - number systems - logic gates - HDL Wednesday 05 SEP 2018: 1.1-1.5, A1-A4, 4.1-4.2.2 - Assigned reading: 1.1-1.5, [A1-A4][appxA], 4.1-4.2.2 Wednesday 05 SEP 2018: Lec – Prof. Spjut Monday 10 SEP 2018: Topic List - Static discipline - CMOS transistors Monday 10 SEP 2018: 1.6-1.9, A5-A7, P-N, Video - Assigned reading: 1.6-1.9, [A5-A7][appxA], [P-N Junction theory](https://www.electronics-tutorials.ws/diode/diode_2.html) - Assigned video viewing: [What are Semiconductors](https://www.youtube.com/watch?v=5ZNeDxfgYAE#t=2m0s) Monday 10 SEP 2018: Lec – Prof. Chang Wednesday 12 SEP 2018: Combo logic - Topic: Combinational logic design Wednesday 12 SEP 2018: 2.1-2.8 - Assigned reading: 2.1-2.8 Wednesday 12 SEP 2018: PS 1 due - [PS 1](PS/ps1.pdf) due Wednesday 12 SEP 2018: Lec – Prof. Chang Monday 17 SEP 2018: Topic List - Timing - sequential circuits Monday 17 SEP 2018: 2.9-2.10, 3.1-3.2 - Assigned reading: 2.9-2.10, 3.1-3.2 Monday 17 SEP 2018: Lab 1 due - [Lab 1](Labs/Lab1.pdf) due: Digital Circuits - Additional material: - [TN2106](DSM/TN2106.pdf) - [TP2104](DSM/TP2104.pdf) - [74HC04](DSM/74HC04.pdf) - [Vid 1 -- Breadboard Intro](https://youtu.be/1XLpFlkJYSs) - [Vid 2 -- Breadboard Intro cont.](https://youtu.be/G9s9GSPMYaQ) - [Vid 3 -- Multimeter, Voltage](https://youtu.be/AfUZwcF2fK0) - [Vid 4 -- Oscilloscope](https://youtu.be/NUueOmbn7FM) - [Vid 5 -- Setting up a Pushbutton](https://youtu.be/gu3hOK5ju-A) - [Vid 6 -- Measuring Switch Bounce](https://youtu.be/zXBsF9GU6xk) - [Vid 7 -- Wiring up an Inverter](https://youtu.be/XEpuRt5Q_-g) - [Vid 8 -- Multimeter, Current](https://youtu.be/K-2FKnhi-pI) - [Vid 9-- Multimeter, Current cont.](https://youtu.be/O2GIpkV2k5s) Monday 17 SEP 2018: Lec – Prof. Chang Wednesday 19 SEP 2018: FSM - Topic: Finite state machines Wednesday 19 SEP 2018: 3.3-3.4 - Assigned reading: 3.3-3.4 Wednesday 19 SEP 2018: PS 2 due - [PS 2](PS/ps2.pdf) due Wednesday 19 SEP 2018: Lec – Prof. Chang Monday 24 SEP 2018: Topic List - Dynamic discipline - Metastability Monday 24 SEP 2018: 3.5-3.7 - Assigned reading: 3.5-3.7 Monday 24 SEP 2018: Lab 2 due - [Lab 2](Labs/Lab2.pdf) due: Combinatorial Logic - Additional material: - [DE0-CV User Manual](DSM/DE0_CV_User_Manual_112.pdf) - [Quartus Prime][qp] - [System Verilog Spec][ver] Monday 24 SEP 2018: Lec – Prof. Chang Wednesday 26 SEP 2018: HDL Verilog - Topic: Hardware description languages: Verilog Wednesday 26 SEP 2018: 4.1-4.3 - Assigned reading: 4.1-4.3 Wednesday 26 SEP 2018: PS 3 due - [PS 3](PS/ps3.pdf) due Wednesday 26 SEP 2018: Lec – Prof. Spjut Monday 01 OCT 2018: Verilog II - Topic: Verilog, Part II Monday 01 OCT 2018: 4.4-4.10 - Assigned reading: 4.4-4.10 Monday 01 OCT 2018: Lab 3 due - [Lab 3](Labs/Lab3.pdf) due: Structural FSM Monday 01 OCT 2018: Lec – Prof. Spjut Wednesday 03 OCT 2018: Arithmetic - Topic: Arithmetic circuits Wednesday 03 OCT 2018: 5.1-5.2 - Assigned reading: 5.1-5.2 Wednesday 03 OCT 2018: PS 4 due - [PS 4](PS/ps4.pdf) due Wednesday 03 OCT 2018: Lec – Prof. Spjut Monday 08 OCT 2018: Numbers - Topic: Fixed and floating point number systems Monday 08 OCT 2018: 5.3 - Assigned reading: 5.3 Monday 08 OCT 2018: Lab 4 due - [Lab 4](Labs/Lab4.pdf) due: Behavioral FSM Monday 08 OCT 2018: Lec – Prof. Spjut Wednesday 10 OCT 2018: Topic List - Sequential building blocks - Memory arrays - Logic arrays Wednesday 10 OCT 2018: 5.4-5.7 - Assigned reading: 5.4-5.7 Wednesday 10 OCT 2018: PS 5 due - [PS 5](PS/ps5.pdf) due Wednesday 10 OCT 2018: Lec – Prof. Spjut Monday 15 OCT 2018: Datasheets, C Programming - Datasheets - C Programming Monday 15 OCT 2018: A.1, C.1-C.7 - Assigned reading: [A.1][appxA], [C.1-C.7][appxC] Monday 15 OCT 2018: Lab 5 due - [Lab 5](Labs/Lab5.pdf) due: Building blocks Monday 15 OCT 2018: Lec – Prof. Spjut Monday 15 OCT 2018: Video – TBD - We hope to have the videos ready Wednesday 17 OCT 2018: **Midterm** Monday 22 OCT 2018: **Fall Break** - No Class Wednesday 24 OCT 2018: C II - Topic: C II Wednesday 24 OCT 2018: C.8-C.11 - Assigned reading: [C.8-C.11][appxC] Wednesday 24 OCT 2018: Video – TBD - We hope to have the videos ready Monday 29 OCT 2018: μ-controllers - Topic: Microcontrollers: Memory-mapped I/O Monday 29 OCT 2018: 9.1-9.3.3 - Assigned reading: [9.1-9.3.3][cpt9] Monday 29 OCT 2018: Lab 6 due - [Lab 6](Labs/Lab6.pdf) due: C - Additional materials: - [STM32F0xx Reference Manual](DSM/stm32f0xxrefmanual.pdf) - [STM32F042x4 Datasheet](DSM/STM32F042x4.pdf) - [Nucleo User Manual](DSM/nucleo32board.pdf) - [ST Nucleo-32 Board][nuc] - [Keil Microcontroller DK][kei] Monday 29 OCT 2018: Video – TBD Wednesday 31 OCT 2018: GPIO - Topic: General Purpose Input and Output Wednesday 31 OCT 2018: 9.3-9.4 - Assigned reading: [9.3-9.4][cpt9] Wednesday 31 OCT 2018: PS6 due - [PS 6](PS/ps6.pdf) due - Additional material: - [STM32F042x4 Datasheet](DSM/STM32F042x4.pdf) Wednesday 31 OCT 2018: Video - TBD Monday 05 NOV 2018: Serial - Topic: Serial Interfacing Monday 05 NOV 2018: Lab 7 due - [Lab 7](Labs/Lab7.pdf) due: C I/O Monday 05 NOV 2018: Video - TBD Wednesday 07 NOV 2018: Assembly - Topic: ARM assembly language Wednesday 07 NOV 2018: 6.1-6.3.6 - Assigned reading: 6.1-6.3.6 Wednesday 07 NOV 2018: PS 7 due - [PS 7](PS/ps7.pdf) due Wednesday 07 NOV 2018: Video - TBD Monday 12 NOV 2018: Func calls -Topic: Function calls, machine language Monday 12 NOV 2018: 6.3.7-6.9 - Assigned reading: 6.3.7-6.9 Monday 12 NOV 2018: Lab 8 due - [Lab 8](Labs/Lab8.pdf) due: C Peripherals - Additional materials: - [lab8starter.c](code/lab8starter.c) - [LIS3DH Accelerometer](DSM/LIS3DH.pdf) - [LED Matrix](DSM/ledmatrix.pdf) Monday 12 NOV 2018: Video - TBD Wednesday 14 NOV 2018: Machine Language - Topic: ARM Machine Language Wednesday 14 NOV 2018: PS 8A due - [PS 8A](PS/ps8A.pdf) due Wednesday 14 NOV 2018: Video - TBD Monday 19 NOV 2018: Datapath - Topic: Single-cycle processor datapath Monday 19 NOV 2018: 7.1-7.3.1 - Assigned reading: 7.1-7.3.1 Monday 19 NOV 2018: Lab 9 due - [Lab 9](Labs/Lab9.pdf) due: Assembly - Additional Materials: - [Cortex M0 TRM][ctx] - [lab9baseline.c](code/lab9baseline.c) - [flash.c](code/flash.c) - [led.s](code/led.s) Monday 19 NOV 2018: Lec – Prof. Spjut Wednesday 21 NOV 2018: **Thanksgiving Break** Monday 26 NOV 2018: Control - Topic: Single-cycle processor control Monday 26 NOV 2018: 7.3, 7.6 - Assigned reading: 7.3, 7.6 Monday 26 NOV 2018: Lec – Prof. Spjut Wednesday 28 NOV 2018: Multicycle P's - Topic: Multicycle processor Wednesday 28 DEC NOV 2018: 7.4 - Assigned reading: 7.4 Wednesday 28 NOV 2018: PS 8B, 9 due - [PS 8B](PS/ps8B.pdf) due - [PS 9](PS/ps9.pdf) due Wednesday 28 NOV 2018: Lec – Prof. Spjut Monday 03 DEC 2018: Pipelining - Topic: Pipelining Monday 03 DEC 2018: 7.5.1-2 - Assigned reading: 7.5.1-2 Monday 03 DEC 2018: Pipelining - Topic: Assistance with PS 10 Monday 03 DEC 2018: Lab 10 due - [Lab 10](Labs/Lab10.pdf) due: Multicycle Proc Monday 03 DEC 2018: Lec – Prof. Spjut Wednesday 05 DEC 2018: Adv Arch - Topic: Advanced architecture: a sampler - Topic: Assistance with Lab 11 Wednesday 05 DEC 2018: 7.7 - Assigned reading: 7.7 Wednesday 05 DEC 2018: PS 10 due - [PS 10](PS/ps10.pdf) due Wednesday 05 DEC 2018: Lec – Prof. Spjut Monday 10 DEC 2018: Class in Lab - Class will be held in the E85 Lab for assistance with Lab 11 Monday 10 DEC 2018: Lec – Prof. Spjut Wednesday 12 DEC 2018: Review - Topic: Class summary and review Wednesday 12 DEC 2018: 1, 2, 3, 4, 5, 6, 7, 9 - Assigned reading: Chapters 1 through 7, Chapter 9, and Appendices A & C Wednesday 12 DEC 2018: Lab 11 due - [Lab 11](Labs/Lab11.pdf) due: Multicycle Proc - Additional mateials: - [arm_single.sv](code/arm_single.sv.txt) - [arm_testbench.sv](code/arm_testbench.sv.txt) - [memfile.s](code/memfile.s) - [memfile.dat](code/memfile.dat.txt) Friday, 14 DEC 2018: Final Exam available - The Final Exam may be picked up from Prof. Spjut's office beginning Friday, 12 Dec 2018 at 8 am. The exam should be completed in one 24 hour period between 8 am on Friday, 14 Dec 2018 and 5 pm on Tuesday, 18 Dec 2018 Tuesday, 18 Dec 2018: Final Exam due - The Final Exam is due by 5 pm on Tuesday, 18 Dec 2018. It will be accepted earlier if you finish it earlier. [appxA]: http://booksite.elsevier.com/9780128000564/content/APP0A_Digital_System_Implementation.pdf [appxC]: http://booksite.elsevier.com/9780128000564/content/APP0C_C_Programming.pdf [cpt9]: http://booksite.elsevier.com/9780128000564/ch9.php [txt]: http://booksite.elsevier.com/9780128000564/index.php [err]: http://booksite.elsevier.com/9780128000564/errata.php [qp]: https://www.altera.com/downloads/download-center.html [ver]: http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=5354441 [nuc]: http://www.st.com/en/evaluation-tools/nucleo-f042k6.html [kei]: https://www.keil.com/demo/eval/arm.htm [ctx]: DSM/DDI0432C_cortex_m0_r0p0_trm.pdf End of the world as we know it.