Course Introduction

Getting Started

  • Getting to know the machine
    • Instructions
    • Operands
  • Humanizing Instructions
    • Assembly Language is not Machine Language
  • How will we create assembly language
    • Hello World
  • Moving to Linux

Spectre and Meltdown

  • Making computers faster
  • Timing tasks
  • Speeding things up
    • Parallel Processing
    • Out of Order Processing
  • Monkey Wrench Time

Architecture Basics

The Von Neumann Machine

  • World War II
  • How the parts are organized
  • Von Neumann’s Machine

The Computer Dance

  • Building a computer
    • The Texas Four-Step
  • Fetch
  • Decode
  • Execute
  • Store
  • Repeat!
  • So, what is a Virtual Machine?
    • Speeding up VMs
  • Simple Oscillator

Let’s Dance

  • Setting up the dance
  • Your role in the dance
  • Dance version 1
    • The Instructor’s role
  • Dance version 2
  • Dance version 3
  • Final Note

C Program Tear-Down

  • Simple C Program
  • Our Goal
  • The processor does not understand structures
    • Branching
    • Sorry, Edsger!
  • Simplifying the logical expression
  • Nothing up my Sleeve!
    • The #define macro
  • Converting to Pentium Instructions
    • Incrementing and absolute branching
    • Declaring variables
  • Eliminating the outer “main” code
  • Arrays
  • Eliminating the pointer notation
  • Now the hard part
  • Wrapping up the translation
    • What the compiler saw
  • NASM version
  • Final comments
  • What instructions did we need?

Computer Performance

  • Clock speed
    • Over-clocking
  • Other performance measures
    • Power consumption
    • Heat
    • Keeping parts busy
      • Parallel processing

Zeros and Ones

Zeros and Ones

  • C++ integers
    • Locating data
    • Show data in binary
  • Counting in binary
    • Patterns
    • Base of a number system
    • Running out of bits
    • Binary counting pattern
    • Hexadecimal
    • Negativity
      • Twos Complement
  • Floating-Point numbers
    • Truncating numbers
    • Basic representation
  • Encoding Characters
    • How big are ACSII Codes?
    • Unicode
  • Encoding other things

Boolean Algebra

  • Arithmetic
    • Addition
    • Subtraction
    • Multiplication
    • Division
  • Truth tables
  • Boolean variables
  • Boolean algebra
  • De Morgan’s Theorems
  • Exclusive OR

Human Numbers vs Digital Numbers

  • Himan kinds of numbers
    • Natural numbers
    • Integers
    • Rational numbers
    • Real numbers
    • Irrational numbers
    • Imaginary numbers
    • Complex numbers
  • Computer numbers
  • Computer math
    • Accumulate

Converting Numbers

  • Notation
  • Converting between the bases
    • Binary to decimal
    • Binary to hexadecimal
    • Decimal to binary
    • Decimal to hexadecimal
    • Hexadecimal to decimal
  • What about negative numbers?

Simulators

Simulating Time

  • Time is important
    • State
  • Modeling time

Simulator Basics

  • Building a computer
    • Components
  • Wires
    • Watching the wires
    • Connecting wires to components
  • Writing the simulator

Building a Simulator

  • We need to “Git” more power
  • Step 1: Create the Project
  • Write some code
  • Make sure it runs
    • Too much typing
  • Introducing Make
    • Makefiles
  • Commit the version
  • Tag this version
  • Reviewing this step

Moving Data

  • C++ classes
    • Object wrappers
  • attiny85sim
  • Step 2 - moving data
    • Modeling the data transfer
    • Reviewing step 2
  • Step 3 - naming components
    • Enhancing our Makefile
    • Makefile target lines
    • Reviewing step 3
  • Step 4 - generic component names
    • Reviewing step 4

Modeling Wires

  • Step 5 - Introducing wires
    • When objects collide
    • Component modifications
    • Wire implementation
    • Reviewing step 5
  • Step 6 - Control logic
    • Reviewing the simulation
    • Adding a Machine class
    • Component class modifications
    • Modifications to main
  • Step 7 - Modeling time
    • Machine class
    • Main function

Automatic Machines

  • Scripting the machine
    • Hardware description languages
  • Little Languages
  • Compiling 101
    • Lexing
    • Parsing
    • Semantic analysis
    • Our compiler
    • Lexical analysis
    • Parsing
  • Step 8 - We need more parts
    • Building the machine

Improving Our Project

  • Step 9 - Refactoring
    • Organizing project code
    • Rebuilding the Makefile
  • Step 10 - Testing your code
  • Catch.hpp
    • Setting up for testing
  • Sanity testing
  • Running tests
    • Testing wires
  • Houston, we have a problem!
  • Step 11: Building test equipment
    Simulating an oscilloscope

AVR Machine Organization

  • CPU Block Diagram
  • Implementation
  • Register Transfer language

Modeling AVR Components

  • Components

Instruction Set Architecture

Defining Languages

  • Formal Languages
    • Defining a language
  • Processing text files
    • Scanner
    • Lexer
    • Parser
  • EBNF definition of a machine

Assembly Language Specification

  • attiny85sim Program files
    • Directives
    • Basic code lines
    • Data declarations
  • Code line components
    • label
    • Mnemonics
    • Operands
    • Comments
    • Rule wrap-up
  • Assembly language grammar

Selecting Instructions to Implement

  • Moving data
  • Defining data
  • Data movement
  • Coding the IF structure
    • Comparing two values
    • Branching
  • Coding a WHILE loop
    • What about the increment
  • ALU instructions
  • Instrution summary

AVR Procedures

  • Introducing the stack
  • Parameters
  • Function stack usage
  • Recursion
    • Function “prologue”
    • Calling a function
    • Returning from a function
  • Accessing parameters

Simple Arduino Code

  • Blinking an LED
    • AVR I/O
    • Writing the code
      • Device configuration
      • Main loop
      • Chip initialization
      • Blinking logic
      • Delay logic
    • Wasting time
  • Building the code
    • Step 1 - install the AVR tools
    • Step 2 - add a Makefile
    • Step 3 - compile your code
    • Step 4 - load the code on the AVR

Connecting the Parts

RTL Specification

  • Not covered yet

Testing, Testing, 123

  • Testing a function
  • Breaking out a unit of code
  • Catch testing
  • Adding a real test
  • Improving the testTestinfg classes

Reviewing the Parts

  • Basic parts
  • Pins
  • Wires
  • Example system

Digital Component Types

  • Combinational parts
    • ALU
    • Multiplexors
  • Sequential components
    • Registers
    • Memory components
      • Read-only memory
      • Read-write memory
  • Component activation
    • Tick Tock

Modeling Our Simulator Components

  • C++ Inheritance
    • Class access control
    • Component models
      • ALU parts
      • Multiplexors
      • Registers
      • Memory components
  • Simulator State Machine
    • Four steps
      • Reset logic
      • Fetch logic
      • Decode logic
      • Execute logic
      • Write-back logic
    • Halting
    • Interrupts
    • C++ State machine code
  • Step 6 - The PC register
    • The Register class
  • Step 1: Fetch
    • Building the Fetch unit
  • Step 2 - Decode
    • Instruction decoding
    • Instruction encoding
      • Register movement instructions
  • Step 2 -Decode logic
  • Step 3 - Execute
    • ADD instruction
      • Timing
      • Fetch
      • Decode
      • Execute
      • Write-back
      • Cycle ends
    • LDS instruction
      • Fetch
      • Decode
      • Execute
      • Write-back
      • Cycle ends
    • Examining instructions
    • Streamlining the RTL
    • Laying out the machine
  • Step 4 - Store
  • Refactoring the design
    • Reviewing our design
    • Python dictionaries
    • declaring a map
      • Map iterators
    • Storing parts in a Map
      • Components
      • Pins
      • Signals
      • Wires
    • Pins?
  • Step 5 - Simulation loop
    • Digital parts
    • Simple simulation loop
      • Generating timing data
    • Simulating component control
    • Event driven simulation

Simulator State Machine

  • Not covered yet

Control Unit Logic

  • Not covered yet

Assembling the Machine (V2)

  • Not included on test

Simplified Decoding Logic

  • Not included on test

Step 7: Loading Data Memory

  • Not included on test

Memory Hierarchy and Caches

Storage Technologies

  • History lesson
  • Random Access Memories
    • Static RAM
    • Dynamic RAM
    • Memory modules
  • Non-volatile RAM
    • Read-only Memory (ROM)
    • Flash Memories
  • The data pathway
  • Disk storage
    • Disk geometry
    • Disk capacity
    • Logical disk blocks
    • Disk operations
  • Solid state Disks
  • Storage technology trends

Sum of Numbers

  • not covered yet
  • Busy work!
  • I hate math!
  • Memory access patterns

Memory Access Patterns

  • (not covered yet)
  • Processing ig data
    • Data stores
  • Access patterns
    • Access time
    • Stream time
    • Modeling a storage device
    • Utility routines
  • Modeling memory access
    • Experiment 1: Modeling random access
    • Experiment 2: Moving data from Memory to registers
  • The real story
  • Adding stream rate
  • Non-sequential processing
  • The final code

Inventing the Cache

  • (not covered yet)
  • Address translation
  • Adding fast memory
  • Modeling the memory unit with cache

AVR and Arduino

AVR Timers

  • Counter operation
    • Normal mode
    • Compare match mode
  • Timer signals
  • Activating the timer
    • control registers
  • COnfiguring the timer
  • Watchdog timer
  • Pulse-Width-Moduleation
    • How does it work?
    • AVR PWM support

Programming the AVR Timers

  • The Piezo buzzer
    • Buzzer code
    • Chip setup
    • The buzzer loop
    • connecting the buzzer
  • What is wrong with this
  • AVR Timers
    • Clock Source
    • Timer counting rates
    • Setting the timer count
    • Maximum timer times
    • Detecting the roll over
    • Configuring the timer
    • Setting the pre-scaler
      • Setting the reload count
      • Detecting roll over
    • Pollng code
      • Skipping instructions
  • Is this better?
    • Building the assembly code
    • Main.S setting up
      • Main.S init chip and start polling
      • Main.S initialize the chip
    • timer.S setting up
      • Timer.S polling delay code
    • How it works
      • The output signal
    • Making the delay shorter
      • The modified delay code
      • Examining the new delay
      • Examining the code

Interrupts

  • What is an interrupt?
    • Asynchronous events
  • Recognizing an interrupt
    • Controlling the global interrupt flag
  • Handling the interrupt
    • AVR interrupt table
    • New style AVR code
    • Interrupt handler code
    • The reset vector
  • Saving processor state
  • Using interrupts with Timer0
    • Sample program
      • The Interrupt jump table
      • Setting the clock
      • Setting up an LED
      • Finishing up
      • Timer code
        • Timer setup
      • Enabling interrupts
      • The handler code
      • Do the work.
      • Finishing up
      • Makefile
    • Wow - We are blinking fast!
      • Counter setup
      • Adding the count logic
      • Blinking only when the count is reached
      • Resetting the count on toggle

Help! My Lights are Making Noise!

  • (not covered yet)
  • Timing analysis
    • Buzzer timing
    • Blinky LED timing
    • Special task
    • Summary of basic timing
  • Wiring the Arduino
    • Defining the pins
  • Organizing your code
    • On to the code
    • A multi-tasking kernel
    • Building the kernel code
      • Timer routines
      • Timer ISR routines
      • The main code
    • The task framework
      • Blinking the LED
      • Buzzing the buzzer
      • What about the last task?
      • Testing your code

Topics here are not testable

All of this material should be in the Appendix

The Command Line

  • Finding the command line
    • Windows Command Line
    • Mac Command Line
    • Linux Command Line
  • Entering commands
    The File System * The “current directory”

Installing VirtualBox

Installing Ubuntu Linux

Installing Tools

Your Development Process

Writing Your Code

Our Development Process

Working With GitHub Classroom

Simplifying Linux Work

Using Git Branches

Project Versions

Creating a Beamer Presentation

Boolean Functions

  • What are these funncions?
  • Why is this interesting?

System Design with Verilog

  • Icarus Verilog
  • Creating the test environment
    • Creating s Docker contianer
    • Automatic compiling
  • Verilog ALU
    • COmpiling the code
    • ALU test bench
    • Testing a counter
    • Installing GTKwave
      • VCD files
  • More information