Computer Organization - Fall 2024

Andreas Moshovos (*)

 

** Warning **

 

There may be errors or omissions in the notes that follow and of course I’m responsible for them. If you do spot an error please let me know. There no intentional errors in the notes. Irrespective of any typos and other errors, you are responsible for the correct answers to questions and problems.

 

If you want to experiment with NIOS II programs outside of the labs I recommend purchasing a SOCkit board.

 

The schedule below is from an earlier offering.

The material and order may change as we move forward.

 

THEMATIC SECTION #1: Understanding what computers do at the low level:

What you need to know to successfully program a computer

 

 

1.  Introduction, course goals, digital systems and why they are useful.

 

2.  Using Binary Quantities to Represent Other Things.

We will not cover real number representations (including floating point) yet. We will do so later in the semester.

**** Self-Assessment Quiz (answers)

**** Program to print out the floating point representation in hexadecimal.

**** Practice questions Answers

·                          More information about floating point numbers – we will not cover or discuss any of this material.

 

3.  Behavioral Model of Memory.

* if there is time we will cover this in the lectures:

       - The DE1 SRAM memory chip interface: lecture slides, datasheet

**** Practice questions

**** Self-Assessment Quiz

 

 

4.  Introduction to the NIOS II programming model.

Practice questions: ADDI and immediates.

*ADDED* SEP 30: Practice question: NIOSII Memory Instructions

Another example of words, half-word, bytes and memory instructions.

 

5.  Simple Control Flow (non straight-line sequencing).

Lecture Slides: A = B + C, if-then-else (PPTX)

 

6.  For loops, arrays and do-while loops.

Another example: a loop over an array of words and an if statement. UPDATED WITH additional, more optimized code on Jan 12, 2024, 9pm

 

7.  Subroutines – Requirements – Calling and Returning

Lecture Slides: i. Calling and Returning (PPTX)

               ii. Call/return execution sequence (PPTX)

           

8.  Subroutines – Passing Arguments

ADDED January 26, 2024

Another example of passing arguments: add7() calling add5() and add2().

      Examples of functions using strings as arguments

      Strings are zero-terminated in C. So “lala” is stored in memory as five bytes: ‘l’, ‘a’, ‘l’, ‘a’, 0.

      You can think of strings as arrays of bytes where the last element is always zero.

      See lecture 2 for more information.
      Another example of subroutine calls

 

 

ADDED January 21, 2024:

   8.1 Bitwise and Shift Operations

   8.2  Function Calls Examples with Bitwise and Shift Operations

 

 

9.  A Recursive Subroutine (Revised January 23, 2024)

 

10.Structures and recursive datatypes
We did not go over the assembly code yet. We will do so later on in the course.

 

10.1     Stack Smashing Attacks (Viruses)

 

 

11.Introduction to I/O Devices: The Parallel Port Interface (PIT) (Revised January 2024)
We are not covering the implementation nor the GPIO PITs

 

12.The Serial Port / Universal Asynchronous Receiver Transmitter (UART)

 

13.Introduction to Interrupts / UART

 

13.1 Introduction to Interrupts / Button PIT

 

14.The Timer Device

This is for reference for your lab.

 

 

   14.1  The Audio Device

         Demo code: movies moo

 

   14.2  The Video Output Device ADDED February 28, 2024

         Sprite demo code

         frame fill demo code

 

15.Code Races.

 

   15.2     Floating-Point Number Representation

            Slide deck

            In lecture 2 there is additional material.

16.Emulating instructions in software via interrupts.

Lecture slides

 

17.A Single-Cycle Processor

 

18.Modifying the single-cycle processor
Slides used in the lectures: singlecycle.ppt

19.Multi-cycle implementation: General principle and the datapath

      Datapath drawing

      Notes formatted for better printing

            Multicycle Slides with Instruction Set, Review of Digital logic components, and datapath (2024) (note that in the slides, the control signals and some temporary registers use a different notation, e.g., instead of K0-K3 registers are referred to as R0-R3, instead of having temporary registers R1 and R2, we have A and B): Slides

 

20.Multi-cycle implementation: The control

      Control drawing

      Slides used in the lectures: multicycle.ppt

      Updated control (2024) with notation that matches above: multicycle-control-full-2024.ppt

 

21.Modifying the multi-cycle implementation

 

22.Pipelined implementation

Lecture slides: pipelining

Description of the SRAM chip to be used in the lab: DE1 SRAM chip. The datasheet for this SRAM chip.

 

23.Multi-programmed Control Optional

 

24.Bus-based datapath/control implementation Optional

 

25.Pipelining example, interrupts, preserving sequential semantics and superscalar: slides.

 

26.Memory Interface: Connecting to Memory and Devices

Slides used in the lectures: bus and devices.pptx

2024: Simple Processor Bus Interface and Memory Mapped I/O: bus and devices simple processor.pptx

 

27.Memory-Mapped I/O: Physical Implementation

 

 

28.Dynamic Scheduling: Out-of-order execution and register renaming: slides.

 

29.A Modern Processor: slides:

 

30.Independence Architectures: VLIW, SIMD, and Vector Processors: slides.

 

31.Graphics processors for general purpose computation: slides.

 

32.Control Flow Prediction: slides.

 

33.Synthesizing Large Memory from Existing Components

 

34.Memory: internal organization and operation, SRAM and DRAM: slides.

 

35.Caches (Prof. Steffan) – We will be going over this material over several lectures. We will cover it in a different way, and we may cover topics not referred to in these notes. Please keep notes during the lectures.

      Additional Notes on Caches

      Examples on Caches and Execution Time

  

35.Replacement policies, Virtual Memory and Multiprocessor systems: slides.

 

36.Floating Point Representation (see earlier notes #2 above): slides.

 

37.Addition and Adder Circuits: slides.

 

38.Multiplication and Division: slides.

 

(*) Permission is given to reproduce these notes provided that a notice of their origin is clearly given. All rights reserved just in case :)