Note: I've just migrated to a different physical server to run Spivey's Corner,
with a new architecture, a new operating system, a new version of PHP, and an updated version of MediaWiki.
Please let me know if anything needs adjustment! – Mike

Digital Systems: Difference between revisions

Copyright © 2017–2023 J. M. Spivey
Jump to navigation Jump to search
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
or, '''How to read a datasheet.'''
{{ContextBox|News Flash|*A new [[The micro:bit toolchain on VirtualBox|VirtualBox image]] can be installed on Windows machines and will allow you to continue experimenting over the vacation, even without acquiring their own Linux machine.
*[[Media:Patt-Henn-Appendix-C.pdf|Appendix C]] from an old edition of Pattersey and Henneson is a short introduction to digital logic that you could read over the vac.  Relevant sections: C.1, C.2, C.3, C.5 omitting Verilog, C.7, C.8, C.10.}}
[[Image:Microbit.gif|thumb|right|300px|The {{Microbit}} (or electronic teabag<ref>So called because the board dangles from its USB cable like a teabag dangling from its string.</ref>)]]
[[Image:Microbit.gif|thumb|right|300px|The {{Microbit}} (or electronic teabag<ref>So called because the board dangles from its USB cable like a teabag dangling from its string.</ref>)]]
{{smallcaps|This is a course}} about how computers work, starting with logic gates and latches, ending with concurrent processes running under a simple operating system, and spending time on machine-level programming in the middle.
{{dropcap|D|igital systems}} is a course about how computers work, from logic gates and latches at the bottom, to concurrent processes at the top (running under a simple operating system), with time spent on machine-level programming in the middle.  For an easy start, we will begin in the middle with small programs written in machine code.
* In Hilary Term, we will study low-level programming with the help of a tiny computer, the [[The BBC micro:bit|BBC {{Microbit}}]], which includes an ARM-based microcontroller as its processor.  Starting in assembly language and moving on to C, we will learn about the instructions that make up machine code, including arithmetic, branching, memory access, and subroutines.  We will also (vitally for embedded systems) learn about controlling I/O devices, such as the buttons and lights on the {{Microbit}} and the serial interface that allows it to talk to a host computer.  Once a program reaches a certain degree of complexity, it is no longer sufficient to wait in a tight loop for an event to happen, and we will study the hardware and software aspects of solutions to this problem: using interrupts to respond to external events, and an operating system to structure the program as a family of concurrent processes, each responsible for one part of the task.
* In Hilary Term, we will study low-level programming with the help of a tiny computer, the [[The BBC micro:bit|BBC {{Microbit}}]], which includes an ARM-based microcontroller as its processor.  Starting in assembly language and moving on to C, we will learn about the instructions that make up machine code, including arithmetic, branching, memory access, and subroutines.  We will also (vitally for embedded systems) learn about controlling I/O devices, such as the buttons and lights on the {{Microbit}} and the serial interface that allows it to talk to a host computer.  Once a program reaches a certain degree of complexity, it is no longer sufficient to wait in a tight loop for an event to happen, and we will study the hardware and software aspects of solutions to this problem: using interrupts to respond to external events, and an operating system to structure the program as a family of concurrent processes, each responsible for one part of the task.
* In Trinity Term, we will study the elements of computer hardware, building up from gates and latches to architectural elements such as registers, adders and decoders, and finally a paper model of a processor able to execute a selection of ARM instructions, supported by an architectural simulator.
* In Trinity Term, we will study the elements of computer hardware, building up from gates and latches to architectural elements such as registers, adders and decoders, and finally a paper model of a processor able to execute a selection of ARM instructions, supported by an architectural simulator.


{{V2box|Most of the materials for the course are written on the assumption that we will be programming the original 'V1' {{microbit}}, with a Cortex-M0 core implementing the Thumb-1 instruction set, in an nRF51822 microcontroller with 16kB of RAM running at 16MHz.  The original {{microbit}} has been superceded by the V2 board, with a Cortex-M4 core implementing the Thumb-2 instruction set, an nRF52833 microcontroller with 128kB of RAM running at 64MHz, and incorporating a floating point unit.  We may be handing out this newer board for use in the lab sessions.  Luckily, the new chip can run programs written for the old chip almost without change, so for simplicity we'll continue to study programs for the old chip, noting differences where they are relevant in text boxes like this one.  The supporting software for the lab has been adjusted to suit the new chip, mostly in ways that will be invisible to participants, with a version for the old chip available alongside.}}
{{V2box|Most of the materials for the course are written on the assumption that we will be programming the original 'V1' {{microbit}}, with a Cortex-M0 core implementing the Thumb-1 instruction set, in an nRF51822 microcontroller with 16kB of RAM running at 16MHz.  The original {{microbit}} has been superceded by the V2 board, with a Cortex-M4 core implementing the Thumb-2 instruction set, an nRF52833 microcontroller with 128kB of RAM running at 64MHz, and incorporating a floating point unit.  We may be handing out this newer board for use in the lab sessions.  Luckily, the new chip can run programs written for the old chip almost without change, so for simplicity we'll continue to study programs for the old chip, noting differences where they are relevant in text boxes like this one.  The supporting software for the lab has been adjusted to suit the new chip, mostly in ways that will be invisible to participants, with a version for the old chip available alongside.}}
{{ContextBox|The V2 {{microbit}}|In the course, we will be avoiding the latest "V2" version of the {{microbit}} and using the older "V1" version, which is slower and has less memory, but has a simpler processor that (vitally for us) is easier to understand.  I will be handing out the remainder of my small stock of V1 boards for use in the labs; but if you buy your own board, it's likely to be a V2 and therefore incompatible.  For simplicity, the lab software we will use this year supports the V1 board only.  A version that supports both V1 and V2 is under development, and will appear with the [https://spivey.oriel.ox.ac.uk/baremetal Bare Metal {{microbit}}] book.}}


==Schedule==
==Schedule==
===Hilary Term===
===Hilary Term===
'''Lectures''' in Lecture Theatre B:
====Lectures====
* Mondays, 10.0&thinsp;am, weeks 2&ndash;8.
* 16 lectures: TBA.
* Tuesdays, 10.0&thinsp;am, weeks 1&ndash;8.
* Friday, 11.0&thinsp;am, week 1.
The lecturer will be unavoidably detained on Monday of First Week, so lectures that week will be on Tuesday and Friday.


<b>Although some elements of the lectures will be automatically recorded, the dynamic blend of slides, calculations on the whiteboard, software demonstrations, computer hardware shown via live video and online instrumentation, and problems solved by the lecturer and class working together means that not all elements will be captured, and the recordings may therefore be almost useless.  In addition, the content of each lecture may change in response to questions from the audience.  Participants who cannot attend lectures in person may find it best to follow the course by reading the extensive [[lecture notes]] available on this site, together with copies of the slides, and joining the weekly consultation sessions.</b>
<b>Although some elements of the lectures will be automatically recorded, the dynamic blend of slides, calculations on the whiteboard, software demonstrations, computer hardware shown via live video and online instrumentation, and problems solved by the lecturer and class working together means that not all elements will be captured, and the recordings may therefore be almost useless.  In addition, the content of each lecture may change in response to questions from the audience.  Participants who cannot attend lectures in person may find it best to follow the course by reading the extensive [[lecture notes]] available on this site.</b>


'''Lab sessions''' in the Thom Building, Department of Engineering Science.  In addition to the official lab times noted above, the lecturer will be available at the same time and in the same place in weeks 3 and 4 to help those who want to get an early start with assembly language programming.
====Lab sessions====
In the Software Lab on Level 6 of the Thom Building, Department of Engineering Science -- the same place as you had practicals for Functional Programming.  In addition to the official lab times noted above, the lecturer will be available at the same time and in the same place in weeks 3 and 4 to help those who want to get an early start with assembly language programming.


* Informal sessions -- Thursdays, 3.0&thinsp;pm &ndash; later, weeks 3 and 4.
* Informal sessions: Monday 10&ndash;12, weeks 3 and 4.
* Official sessions -- Thursdays, 3.0&ndash;5.0&thinsp;pm, weeks 5&ndash;8.
* Official sessions: Monday 10&ndash;12, weeks 5&ndash;8.


'''Consultation sessions:''' the lecturer will be available online to answer questions at set weekly times:
There will be no lab sessions in Trinity Term.
* Mondays, 2.0&ndash;3.0&thinsp;pm, weeks 2&ndash;8.  [[Oxford:Consultation sessions|Joining link]] (requires login).
 
These sessions are organised for the benefit of participants who are self-isolating or have been prevented from returning to Oxford, but others are welcome to join also.
====Tutorials====
Your college will organise tutorials in this subject, as in others. To support them, there are four [[problem sheets]] this term, two on machine-level programming, one on I/O devices, and one on embedded operating systems.


===Trinity Term===
===Trinity Term===
To be decided.
====Lectures====
* 8 lectures, TBA.
 
====Tutorials====
Two more tutorials are suggested, with a problem sheet on digital design, and another on processor architecture.


==Resources==
==Resources==
Line 46: Line 46:
* A [[glossary]], defining terms used in the course.
* A [[glossary]], defining terms used in the course.
* A useful page listing the [[Thumb instructions by lecture|Thumb instructions]] introduced in each lecture.
* A useful page listing the [[Thumb instructions by lecture|Thumb instructions]] introduced in each lecture.
And last of all:
* There's a website for my book [https://spivey.oriel.ox.ac.uk/baremetal Bare Metal {{microbit}}], containing expanded versions of the lab materials for the course, with explanations appended.


==Miscellaneous==
==Miscellaneous==
Line 51: Line 53:
* Notes for the project of [[The microbian project|extending and porting {{microbian}}]].
* Notes for the project of [[The microbian project|extending and porting {{microbian}}]].
* A list of ways of [[Programming the micro:bit|programming the {{microbit}}]].
* A list of ways of [[Programming the micro:bit|programming the {{microbit}}]].
* A check-list of [[preparation tasks]] to negotiate with IT Support.
* Copies of any special [[handouts]].


==Links==
==Links==

Revision as of 10:33, 30 January 2023

The micro:bit (or electronic teabag[1])

Digital systems is a course about how computers work, from logic gates and latches at the bottom, to concurrent processes at the top (running under a simple operating system), with time spent on machine-level programming in the middle. For an easy start, we will begin in the middle with small programs written in machine code.

  • In Hilary Term, we will study low-level programming with the help of a tiny computer, the BBC micro:bit, which includes an ARM-based microcontroller as its processor. Starting in assembly language and moving on to C, we will learn about the instructions that make up machine code, including arithmetic, branching, memory access, and subroutines. We will also (vitally for embedded systems) learn about controlling I/O devices, such as the buttons and lights on the micro:bit and the serial interface that allows it to talk to a host computer. Once a program reaches a certain degree of complexity, it is no longer sufficient to wait in a tight loop for an event to happen, and we will study the hardware and software aspects of solutions to this problem: using interrupts to respond to external events, and an operating system to structure the program as a family of concurrent processes, each responsible for one part of the task.
  • In Trinity Term, we will study the elements of computer hardware, building up from gates and latches to architectural elements such as registers, adders and decoders, and finally a paper model of a processor able to execute a selection of ARM instructions, supported by an architectural simulator.

The V2 micro:bit

In the course, we will be avoiding the latest "V2" version of the micro:bit and using the older "V1" version, which is slower and has less memory, but has a simpler processor that (vitally for us) is easier to understand. I will be handing out the remainder of my small stock of V1 boards for use in the labs; but if you buy your own board, it's likely to be a V2 and therefore incompatible. For simplicity, the lab software we will use this year supports the V1 board only. A version that supports both V1 and V2 is under development, and will appear with the Bare Metal micro:bit book.

Schedule

Hilary Term

Lectures

  • 16 lectures: TBA.

Although some elements of the lectures will be automatically recorded, the dynamic blend of slides, calculations on the whiteboard, software demonstrations, computer hardware shown via live video and online instrumentation, and problems solved by the lecturer and class working together means that not all elements will be captured, and the recordings may therefore be almost useless. In addition, the content of each lecture may change in response to questions from the audience. Participants who cannot attend lectures in person may find it best to follow the course by reading the extensive lecture notes available on this site.

Lab sessions

In the Software Lab on Level 6 of the Thom Building, Department of Engineering Science – the same place as you had practicals for Functional Programming. In addition to the official lab times noted above, the lecturer will be available at the same time and in the same place in weeks 3 and 4 to help those who want to get an early start with assembly language programming.

  • Informal sessions: Monday 10–12, weeks 3 and 4.
  • Official sessions: Monday 10–12, weeks 5–8.

There will be no lab sessions in Trinity Term.

Tutorials

Your college will organise tutorials in this subject, as in others. To support them, there are four problem sheets this term, two on machine-level programming, one on I/O devices, and one on embedded operating systems.

Trinity Term

Lectures

  • 8 lectures, TBA.

Tutorials

Two more tutorials are suggested, with a problem sheet on digital design, and another on processor architecture.

Resources

Information about the course is provided on several other pages.

And last of all:

  • There's a website for my book Bare Metal micro:bit, containing expanded versions of the lab materials for the course, with explanations appended.

Miscellaneous

Links



  1. So called because the board dangles from its USB cable like a teabag dangling from its string.