lecture 5
lecture 5
Lecture 5
Computer Architecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 1
Nand to Tetris Roadmap: Hardware
abstraction
machine
language p4 Previous lecture:
Introducing a
machine language
developing
an assembler
abstraction
hardware platform
building a p2 p3
computer abstraction
computer
building
abstraction
p1
ALU, RAM
chips building
elementary
logic gates gates
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 2
Nand to Tetris Roadmap: Hardware
abstraction
machine
language p4 Previous lecture:
Introducing a
machine language
developing
an assembler
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 3
Nand to Tetris Roadmap: Hardware
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 4
Computer Architecture
Memory CPU
data register
program data register
input ALU output
data register
Program Counter
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 5
Computer Architecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 6
Early computers: 17th century
Blaise Pascal
1623 – 1662
Pascal’s Calculator
(Pascaline, 1652)
• Add
• Subtract
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 7
Early computers: 17th century
Gottfried Leibniz
1646 – 1716
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 8
Early computers: 19th century
Milestone:
punched cards / software
Programmable!
“If it should turn out that the basic logic of a machine designed for the numerical
solution of differential equations coincides with the logic of a machine intended to
make bills for department stores, I would regard this as the most amazing coincidence
I have ever encountered” –– Howard Aiken (Mark 1 computer architect, 1956)
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 12
Basic architecture
Memory CPU
data register
program data register
ALU
data register
Program Counter
Computer:
A machine that uses instructions to manipulates data
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 13
Basic architecture
Memory CPU
data register
program data register
The computer can be viewed
data register
ALU as a set of chips, connected by
pathways (buses).
data address register
Program Counter
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 14
Computer architecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 15
Computer architecture
Memory CPU
Basic loop
data register • Fetch
program an instruction
data register
(by supplying
an address)
ALU • Execute
data register
the instruction
data address register
• (and figure out the
PC
address of the next
instruction)
Program Counter
Always emits the address
of the next instruction
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 16
Fetch an instruction
Memory CPU
Basic loop
data register • Fetch
program an instruction
data register
(by supplying
an address)
ALU • Execute
data register
the instruction
data address register
• (and figure out the
PC
address of the next
instruction)
Program Counter
Always emits the address
address instruction of the next instruction
address bus
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 17
Fetch an instruction
Memory CPU
Basic loop
data register • Fetch
program an instruction
data register
(by supplying
an address)
ALU • Execute
data register
the instruction
data address register
• (and figure out the
PC
address of the next
instruction)
instruction instruction
control bus
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 18
Execute the instruction
Memory CPU
Basic loop
data register • Fetch
program an instruction
data register
(by supplying
an address)
ALU • Execute
data register
the instruction
data address register
• (and figure out the
PC
address of the next
instruction)
instruction instruction
control bus
program instruction
out
ALU
data
Possible solutions:
address • Two-cycle, one-memory machine
• One-cycle, two-memory machine
instruc. data
address address
Should we feed the instruction
control address,
bus or the data address?
address bus
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 20
Two-cycle, one-memory machine
Memory
program instruction
out
ALU
data
address
instruc. data
address address
control bus
address bus
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 21
Two-cycle, one-memory machine
Memory
when
program fetching instruction instruction
register
out
DMux ALU
data
address
Mux
control bus
address bus
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 22
Two-cycle, one-memory machine
Memory
when
program fetching instruction instruction
register
out
DMux ALU
data
fetch /
address
execute Fetch cycle: Loads an instruction into the
bit instruction register
Mux
Execute cycle: Loads a data value from
(when
memory, and executes the instruction
instruc. data (when
fetching) address address executing)
control bus
address bus
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 23
Single cycle, two-memory machine
data register
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 24
Single cycle, two-memory machine
data register
Advantages Disadvantages
• Simple architecture • Two memory chips
• Fast processing • Separate address spaces
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 25
Chapter 5: Computer Architecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 26
The Hack computer
instruc- write
D register
tion
read
program A register ALU data
address
address PC
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 27
CPU abstraction
A chip that implements the Hack instruction set:
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 28
CPU abstraction
D register
A register
Instruction
examples:
// D = RAM[5] + 1 1. Executes the current instruction
@5
2. Figures out which instruction to execute next
DM=M+1
…
// goto 200
@200
0;JMP
…
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 29
CPU abstraction
D register
A register
Instruction
examples:
// D = RAM[5] + 1 1. Executes the current instruction:
@5 If it’s an A-instruction (@ xxx), sets the A register to xxx
DM=M+1 Else (C-instruction):
… • Computes the ALU function specified by the instruction (on the values of A, D, inM)
// goto 200 • Puts the ALU output in A, D, outM, as specified by the instruction
@200 • If the instruction writes to M, sets addressM to A and asserts writeM
0;JMP
…
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 30
CPU implementation
pc
pc
if c = 1
outM
if c = 0
@5 0000000000000101
inM
writeM
Handling A-instructions
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 33
CPU implementation: Instruction handling
if c = 1
outM
if c = 0
@5 0000000000000101
inM
writeM
Handling A-instructions
Use the instruction’s MSB (op-code) to manipulate the control bits
of the A register and the Mux16 before it.
Effect: A-register instruction (treated as a value)
(Exactly what the @ xxx instruction specifies: “set A to xxx”)
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 34
CPU implementation: Instruction handling
if c = 1
outM
if c = 0
1110011111010111
D=D+1;JMP
inM
writeM
Handling C-instructions
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 35
CPU implementation: Instruction handling
opcode bit
comp bits
dest bits
jump bits
if c = 1
outM
if c = 0
1110011111010111
D=D+1;JMP
inM
writeM
Handling C-instructions
Each instruction field (opcode, comp, dest, and jump bits) is handled separately
Each group of bits is used to ”tell” a CPU chip-part what to do
Taken together, the chip-parts end up executing the instruction.
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 36
CPU implementation: Instruction handling
opcode bit
comp bits
dest bits
jump bits
if c = 1
outM
if c = 0
1110011111010111
D=D+1;JMP 1
inM
writeM
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 37
CPU implementation: Instruction handling
opcode bit
comp bits
011111
dest bits
jump bits
if c = 1
outM
if c = 0
1110011111010111
D=D+1;JMP
inM
writeM
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 38
CPU implementation: Instruction handling
opcode bit
comp bits
dest bits
jump bits
outM
1110011111010111
D=D+1;JMP
inM
writeM
ALU output:
• Result of ALU calculation
• Fed simultaneously to D-register, A-register, data memory
• Each enabled/disabled by its control bit
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 39
CPU implementation: Instruction handling
opcode bit
comp bits
dest bits
jump bits
outM
1110011111010111
D=D+1;JMP
inM
writeM
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 40
CPU implementation: Instruction handling
opcode bit
comp bits
dest bits 1
jump bits 0
outM
1110011111010111
D=D+1;JMP
inM
writeM
0
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 41
CPU implementation: Instruction handling
opcode bit
comp bits
1 011111
dest bits
jump bits 0
outM
1110011111010111
D=D+1;JMP 1
inM
writeM
0
0
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 42
CPU implementation: Control
pc
111accccccdddjjj
16
load zr ng
1
pc
16
...
address of next
PC abstraction instruction
Outputs the address of the next instruction, has three states:
reset: PC 0
no jump: PC++
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 44
CPU implementation: Control
111accccccdddjjj
16
load zr ng
1
pc
16
...
address of next
PC abstraction instruction
Outputs the address of the next instruction, has three states:
reset: PC 0
no jump: PC++
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 45
CPU implementation: Control
Symbolic
syntax:
dest = comp ; jump
Binary
1 1 1 a c c c c c c d d d j1 j2 j3
syntax:
jump j1 j2 j3 condition f
null 0 0 0 no jump
JGT 0 0 1 if (ALU out > 0) jump
JEQ 0 1 0 if (ALU out = 0) jump
out
JGE 0 1 1 if (ALU out ≥ 0) jump ALU
JLT 1 0 0 if (ALU out < 0) jump
JNE 1 0 1 if (ALU out ≠ 0) jump
JLE 1 1 0 if (ALU out ≤ 0) jump
zr = (out == 0, 1, 0)
JMP 1 1 1 Unconditional jump
zr ng ng = (out < 0, 1, 0)
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 46
CPU implementation: Control
111accccccdddjjj
16
load zr ng
1
pc
16
...
PC implementation address of next
instruction
if (reset = 1) PC 0 // reset
else
if ( J (jump bits, zr, ng) = 1) PC A // jump
else PC++ // next instruction
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 47
CPU implementation
pc
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 48
Computer Architecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 49
Hack computer
instruc- write
D register
tion
read
program A register ALU Data
address
address PC
I/O devices
• Screen
• Keyboard
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 50
Screen
load
Physical screen
Screen 0 1 2 3 4 5 6 7 8 ... 511
0 0000000010101111 0 ...
Screen refresh ...
1 0000000000000000 1
...
in 31 1000000000000000
32 0000101000000000
16
... ...
33 0000000000000000 out
...
63 0000000000000000
address 16
... ...
255
8159 0000000010101101
13 8160 0000000000000000
...
/** Memory of 8K 16-bit registers
8191 0000000000000000 with a display-unit side effect. */
CHIP Screen {
IN address[13], in[16], load;
OUT out[16];
Implemented as a built-in 8K BUILTIN Screen;
memory chip named Screen CLOCKED in, load;
}
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 51
Keyboard
Keyboard
out
0000000000000000
16
refresh
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 52
Keyboard
Keyboard
out
0000000000000000
0000000001001011 k
16
refresh
code('k') = 75
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 53
Keyboard
Keyboard
out
0000000000000000
16
refresh
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 54
Chapter 5: Computer Architecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 55
Memory
Overview
Instruction Memory CPU Symbolic programming
Memory
• Intro • Control
• Computer architecture • Variables
instruc- write
D register
• The Hack CPU
tion • Labels
read
•program
Input / output A register ALU Data
address
• Memory address PC
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 56
Memory: Implementation
load
Memory
0
in
16 RAM16K
out
address 16
16383
15 16384
Screen
(8K)
24575
24576 Keyboard
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 57
Memory: Implementation
load
in
built in project 3
Memory 16
0 out
RAM16K
16
in address
16 14
RAM16K
out
address 16 in
16383
15 16
16384 Screen out
Screen address
16
(8K) 13
24575 built-in chip
24576 Keyboard
out
Keyboard
16
built-in chip
Memory architecture
• An aggregate of three chip-parts: RAM16K, Screen, Keyboard
• Single address space, 0 to 24576 (0x6000)
• Maps the address input onto the address input of the relevant chip-part.
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 58
Instruction memory
Overview
Instruction Memory CPU Symbolic programming
Memory
• Intro • Control
• Computer architecture • Variables
instruc- write
D register
• The Hack CPU
tion • Labels
read
•program
Input / output A register ALU Data
address
• Memory address PC
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 59
Instruction memory
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 60
Instruction memory
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 61
Chapter 5: Computer Architecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 62
Hack computer architecture
ROM32K
Overview CPU Memory
Symbolic programming
• Intro • Control
• Computer architecture • Variables
instruc- write
D register
• The Hack CPU
tion • Labels
read
•program
Input / output A register ALU Data
address
• Memory address PC
Remaining challenge
Integrate into a single chip, named Computer
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 63
Computer abstraction
Assumption
reset
To execute the stored program:
set reset ← 1, then
set reset ← 0
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 64
Computer abstraction
Assumption
reset
To execute the stored program:
set reset ← 1, then
set reset ← 0
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 65
Computer implementation
reset
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 66
Computer implementation
reset
Implementation
Connect the three chip-parts
along these lines.
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 67
Computer implementation
reset
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 68
Computer Architecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 69
Computer Architecture
reset
Project 5
• CPU
• Memory
• Computer
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 70
CPU
PARTS:
//// Put you code here
}
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 71
CPU
Implementation tips
• All the chip-parts seen here were built in projects 1, 2, 3
• But: we’ll use their built-in versions
• Use HDL to unpack the instruction bits and connect them to the control bits of chip-parts
• Use gate logic to compute the address of the next instruction.
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 72
Computer Architecture
reset
Project 5:
• CPU
• Memory
• Computer
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 73
Memory
load Memory.hdl
/** Complete address space of the computer’s data memory,
Memory including RAM, screen memory map, and keyboard memory map.
0 Outputs the value of the memory location specified by address.
If (load==1), the in value is loaded into the memory location specified by address.
Addressing space rules:
in
Only the upper 16K+8K+1 words of the memory are used.
16 RAM16K Access to address 0 to 16383 (0x0000 to 0x3FFF) results in accessing the RAM;
out Access to address 16384 to 24575 (0x4000 to 0x5FFF) results in accessing the Screen memory map;
16 Access to address 24576 (0x6000) results in accessing the Keyboard memory map.
address 16383 */
16384
15 CHIP Memory {
Screen
IN address[15], in[16], load;
(8K memory map)
OUT out[16];
24575
PARTS:
24576 Keyboard //// Put your code here.
}
Implementation tips
• Two bits in the address input can be used to determine the target memory-part (RAM16K, Screen, Keyboard)
• The remaining bits of the address input are the target address within the target memory-part
• Do the read/write specified by the Memory’s inputs,
and output the value of the selected memory-part[address] to the Memory’s out output.
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 74
Memory
load Memory.hdl
/** Complete address space of the computer’s data memory,
Memory including RAM, screen memory map, and keyboard memory map.
0 Outputs the value of the memory location specified by address.
If (load==1), the in value is loaded into the memory location specified by address.
Addressing space rules:
in
Only the upper 16K+8K+1 words of the memory are used.
16 RAM16K Access to address 0 to 16383 (0x0000 to 0x3FFF) results in accessing the RAM;
out Access to address 16384 to 24575 (0x4000 to 0x5FFF) results in accessing the Screen memory map;
16 Access to address 24576 (0x6000) results in accessing the Keyboard memory map.
address 16383 */
16384
15 CHIP Memory {
Screen
IN address[15], in[16], load;
(8K memory map)
OUT out[16];
24575
PARTS:
24576 Keyboard //// Put your code here.
}
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 75
Computer
reset
Project 5:
• CPU
• Memory
• Computer
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 76
Computer
reset
/** The Hack computer, including CPU, RAM and ROM, loaded with a program.
When (reset==1), the computer executes the first instruction in the program;
When (reset==0), the computer executes the next instruction in the program. */
CHIP Computer {
IN reset; Implementation tips
PARTS: Use the built-in ROM32K
// Put your code here.
}
Follow the diagram, and use HDL to connect the three chip-parts
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 77
Computer Architecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 78
Testing the Computer chip
Testing logic Computer.hdl
Test programs
• Add.hack:
RAM[0] ← 2 + 3
• Max.hack:
RAM[2] ← max(RAM[0], RAM[1])
• Rect.hack:
Draws a rectangle of RAM[0] rows
of 16 pixels each.
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 79
Testing the Computer chip
ComputerMax.tst
Testing logic load Computer.hdl,
output-file ComputerMax.out,
• Load Computer.hdl into the compare-to ComputerMax.cmp,
hardware simulator output-list time reset ARegister[] DRegister[] PC[]
RAM16K[0] RAM16K[1] RAM16K[2];
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 80
Testing the Computer chip
Testing logic
• Load Computer.hdl into the
hardware simulator
• Load a Hack program
into the ROM32K chip-part
Rect.hack output:
• Run the clock enough cycles
to execute the program
R0
Test programs
• Add.hack:
RAM[0] ← 2 + 3
• Max.hack:
RAM[2] ← max(RAM[0], RAM[1]) Test script
• Rect.hack: • ComputerRect.tst
Draws a rectangle of RAM[0] rows
of 16 pixels each. • Inspect it, understand the testing logic.
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 81
What’s next?
abstraction
writing
machine low-level
language p4
programs
developing
an assembler p6 Next lecture
This lecture
Nand to Tetris / www.nand2tetris.org / Chapter 5 / Copyright © Noam Nisan and Shimon Schocken Slide 82