Von Neumann architecture and the fetch-decode-execute cycle
Program instructions and data share one memory. Step through a small program (LOAD, ADD, STORE) and watch the registers, the three buses and the memory change.
Processor (CPU)
Buses
Main memory (RAM)
Cycle log
CISC and RISC processors
Compare the two designs, then watch RISC-style pipelining overlap the five stages of each instruction.
| CISC features | RISC features |
|---|---|
| Many instruction formats are possible | Uses fewer instruction formats/sets |
| There are more addressing modes | Uses fewer addressing modes |
| Makes use of multi-cycle instructions | Makes use of single-cycle instructions |
| Instructions can be of a variable length | Instructions are of a fixed length |
| Longer execution time for instructions | Faster execution time for instructions |
| Decoding of instructions is more complex | Makes use of general multi-purpose registers |
| More difficult to make pipelining work | Easier to make pipelining function correctly |
| Design emphasis is on the hardware | Design emphasis is on the software |
| Uses the memory unit to allow complex instructions | Processor chips require fewer transistors |
Pipelining simulator
Stages: IF (instruction fetch), ID (decode), OF (operand fetch), IE (execute), WB (write-back). Each stage takes one clock cycle.
Logic gates, half adder and full adder
Choose a gate to see its truth table, then set the inputs of the adders.
Inputs
Half adder (A and B)
Full adder (A, B and Cin)
Karnaugh maps
Click an output (X) in the truth table or a cell in the K-map to flip it. The simplest sum-of-products expression is found for you. The K-map columns use Gray code (00, 01, 11, 10) so neighbours differ by one bit.
SR flip-flop (NOR gates)
Two cross-coupled NOR gates store one bit. Toggle S (set) and R (reset) and watch Q and its inverse change. Try S = 1, then S = 0 to see the memory.
| S | R | Q | Q̅ | Comment |
|---|
Shortest path: A* and Dijkstra
Step through each algorithm on the textbook graph. Dijkstra expands the node with the smallest g (cost so far). A* expands the smallest f = g + h, where h is the heuristic estimate to the goal.