Lecture notes: Difference between revisions

Copyright © 2017–2023 J. M. Spivey
Jump to navigation Jump to search
No edit summary
 
(44 intermediate revisions by the same user not shown)
Line 7: Line 7:
The first few lectures will be about programming a microprocessor in assembly language, including the detail of how each kind of instruction operates.
The first few lectures will be about programming a microprocessor in assembly language, including the detail of how each kind of instruction operates.


{{Lecture|1|Microcontrollers and embedded programming|Architecture of the {{microbit}}. Programmer's model. Execution of an instruction.}}
{{Section1}}


{{Lecture|2|Building a program|Compiling and building a program.}}
* A set of [[Media:Digisys-slides-a.pdf|slides]] used in the lectures.
 
{{Lecture|3|Multiplying numbers|Conditional and unconditional branches. Instruction encodings. Execution time.}} ([[Media:Digisys-handout-3.pdf|Handout]])
 
{{Lecture|4|Number representations|Signed and unsigned numbers. Numeric comparisons.}} ([[Media:Digisys-handout-4.pdf|Handout]])
 
{{Lecture|5|Loops and subroutines|A better multiplication algorithm. Stack frames. Recursive calculation of binomial coefficients.}} ([[Media:Digisys-handout-5.pdf|Handout]] for this lecture and the next)
 
{{Lecture|6|Memory and addressing|Addressing modes. Arrays. Example: Catalan numbers.}}
 
{{Lecture|7|Buffer overrun attacks|A hacker's guide.}} ([[Media:Digisys-handout-7.pdf|Handout]])
 
* A set of [[Media:Digisys-slides-a.pdf|slides]] used in the lectures, put here as a convenient way to make them available for displaying -- and [[:File:Digisys-slides-a.pdf|updated]] when necessary.  (All contain the same information as in the notes.)


===Input and output===
===Input and output===
The next lectures are about different kinds of I/O interaction, including interrupts.
The next lectures are about different kinds of I/O interaction, including interrupts.


{{Lecture|8|Introducing I/O|Memory-mapped I/O. GPIO. Multiplexed LED display.}} ([[Media:Digisys-handout-8.pdf|Handout]] for this lecture and the next)
{{Section2}}


{{Lecture|9|Serial I/O|Serial protocol.  A simple, polling UART driver.}}
* A set of [[Media:Digisys-slides-b.pdf|slides]] used in these lectures.
 
{{Lecture|10|Programming with interrupts|Interrupt-based driver for UART.}} ([[Media:Digisys-handout-10.pdf|Handout]] for this lecture and the next)
 
{{Lecture|11|The interrupt mechanism|What the hardware does with interrupts.}}
 
* A set of [[Media:Digisys-slides-b.pdf|slides]] used in these lectures, again [[:File:Digisys-slides-b.pdf|updated]] when necessary.


===Embedded operating systems===
===Embedded operating systems===
[Changes as a result of the planned UCU strike are shown in {{Span|style="color: red"|red}}.]
The last part of Hilary Term has lectures about using and then implementing a simple process scheduler, allowing asynchronous events to be handled in a manageable way.
 
{{StrikeFix|The first part of Trinity Term|The last part of Hilary Term}} has lectures about using and then implementing a simple process scheduler, allowing asynchronous events to be handled in a manageable way.
 
{{Lecture|12|Introducing {{Phos}}|Processes and messages.}}


{{Lecture|13|Device drivers|Server processes.  Interrupts as messages from the hardware.}}
{{Section3}}


{{Stricken|{{Lecture|14|Context switching|Implementing interleaving of processes by saving and restoring context.}}}}
* A set of [[Media:Digisys-slides-c.pdf|slides]] used in these lectures.
 
{{Stricken|{{Lecture|15|Implementing processes and messages|Process table.  Ready queue. Send and receive.}}}}
 
{{Stricken|{{Lecture|16|We're going on a bug hunt!|Exploring the operating system by fixing a bug.}}}}
 
* A third set of [[Media:Digisys-slides-c.pdf|slides]], also [[:File:Digisys-slides-c.pdf|updated]] when necessary.


==Trinity Term==
==Trinity Term==
Line 59: Line 31:
In the first part of Trinity Term, the lectures are about constructing logic gates from transistors, and then building those logic gates into modules we can later use to design a computer.  Helpful reading for this part of the course is the appendix on [[Media:Patt-Henn-Appendix-C.pdf|Basics of Logic Design]] from the recommended book by Patterson and Hennessy.
In the first part of Trinity Term, the lectures are about constructing logic gates from transistors, and then building those logic gates into modules we can later use to design a computer.  Helpful reading for this part of the course is the appendix on [[Media:Patt-Henn-Appendix-C.pdf|Basics of Logic Design]] from the recommended book by Patterson and Hennessy.


{{Lecture|17|Introduction|Plan for the term.  Combinational logic.}}
{{Section4}}
 
{{Lecture|18|Transistors and logic gates|Building gates from transistors.  CMOS logic.}}
 
{{Lecture|19|Sequential logic|Flip-flops.  Designing sequential circuits.}}


{{Lecture|20|Architectural elements|Circuits for arithmetic.  Multiplexers.  Register files.  Arithmetic-Logic Unit.  Barrel shifter.}}
* A set of [[Media:Digisys-slides-d.pdf|slides]] used in the lectures.
 
* Another set of [[Media:Digisys-slides-d.pdf|slides]] for the lectures, with the usual [[:File:Digisys-slides-d.pdf|update link]].


===Microprocessor architecture===
===Microprocessor architecture===
The second part of Trinity Term has lectures about using architectural modules to build a simplified implementation of the Thumb instruction set.
The second part of Trinity Term has lectures about using architectural modules to build a simplified implementation of the Thumb instruction set.


{{Lecture|21|Designing a datapath|}}
{{Section5}}
 
[22] Continuation.
 
{{Stricken|[23] {{Phos}} device drivers -- a sample exam question.}}
 
{{Stricken|{{Lecture|24|Three instructions|Using the datapath to implement three typical instructions.}}}}


* The final set of [[Media:Digisys-slides-e.pdf|slides]], with an [[:File:Digisys-slides-e.pdf|update link]].
* A set of [[Media:Digisys-slides-e.pdf|slides]] used in the lectures.
* [[Media:Digisys-slides-f.pdf|Slides]] for the last lecture.

Latest revision as of 15:47, 17 April 2023

Each lecture title is a link to notes for that lecture. The notes for some lectures have a section at the end for questions asked during or after that lecture by the audience this year or in previous years.

Hilary Term

Assembly-language programming

The first few lectures will be about programming a microprocessor in assembly language, including the detail of how each kind of instruction operates.

[1] Microcontrollers and embedded programming. Architecture of the micro:bit. Programmer's model. Execution of an instruction.

[2] Building a program. Compiling and building a program.

[3] Multiplying numbers. Conditional and unconditional branches. Instruction encodings. Execution time.

[4] Number representations. Signed and unsigned numbers. Numeric comparisons.

[5] Loops and subroutines. A better multiplication algorithm. Stack frames and nested suboroutines.

[6] Memory and addressing. Addressing modes. Arrays. Example: "Bank accounts".

[7] Buffer overrun attacks. A hacker's guide.

  • A set of slides used in the lectures.

Input and output

The next lectures are about different kinds of I/O interaction, including interrupts.

[8] Introducing I/O. Memory-mapped I/O. GPIO. Multiplexed LED display.

[9] Serial I/O. Serial protocol. A simple, polling UART driver.

[10] Programming with interrupts. Interrupt-based driver for UART.

[11] The interrupt mechanism. What the hardware does with interrupts.

  • A set of slides used in these lectures.

Embedded operating systems

The last part of Hilary Term has lectures about using and then implementing a simple process scheduler, allowing asynchronous events to be handled in a manageable way.

[12] Introducing micro:bian. Processes and messages.

[13] Device drivers. Server processes. Interrupts as messages from the hardware.

[14] Context switching. Implementing interleaving of processes by saving and restoring context.

[15] Implementing processes and messages. Process table. Ready queue. Send and receive.

[16] A device driver. Writing a driver for a simple I/O device.

  • A set of slides used in these lectures.

Trinity Term

A Thumb datapath

Hardware elements

In the first part of Trinity Term, the lectures are about constructing logic gates from transistors, and then building those logic gates into modules we can later use to design a computer. Helpful reading for this part of the course is the appendix on Basics of Logic Design from the recommended book by Patterson and Hennessy.

[17] Introduction. Plan for the term. Combinational logic.

[18] Transistors and logic gates. Building gates from transistors. CMOS logic.

[19] Sequential logic. Flip-flops. Designing sequential circuits.

[20] Example of a sequential circuit.

[21] Architectural elements. Circuits for arithmetic. Multiplexers. Register files. Arithmetic-Logic Unit. Barrel shifter.

  • A set of slides used in the lectures.

Microprocessor architecture

The second part of Trinity Term has lectures about using architectural modules to build a simplified implementation of the Thumb instruction set.

[22] Designing a datapath.

[23] Designing a datapath (continued). Continuation

[24] Three instructions. Using the datapath to implement three typical instructions.

  • A set of slides used in the lectures.
  • Slides for the last lecture.