Professional Documents
Culture Documents
Lecture 03 Sequential Logic
Lecture 03 Sequential Logic
www.nand2tetris.org
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 1
Usage and Copyright Notice:
This presentation contains lecture materials that accompany the textbook “The Elements of
Computing Systems” by Noam Nisan & Shimon Schocken, MIT Press, 2005.
Our web site, www.nand2tetris.org ,features a set of presentations, one for each book chapter.
Each presentation is designed to support about 3 hours of classroom or self-study instruction.
You are welcome to use or edit this presentation as you see fit for instructional and non-
commercial purposes.
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 2
Sequential VS combinational logic
Combinational devices: operate on data only;
provide calculation services (e.g. Nand … ALU)
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 3
Lecture plan
Clock
Flip-flop gates
Binary cells
Registers
RAM
Counters
Perspective.
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 4
The Clock HW
simulator
demo
in DFF out
out(t) = in(t-1)
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 6
1-bit register (we call it “Bit”)
in out
DFF
out(t) = out(t-1) ?
out(t) = in(t-1) ?
Won’t work
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 7
Bit register (cont.) HW
simulator
demo
Interface Implementation
o Load bit
o Read logic
o Write logic
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 8
Multi-bit register HW
simulator
demo
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 9
Aside: Hardware Simulation HW
simulator
demo
Relevant topics from the HW simulator tutorial:
Clocked chips: When a clocked chip is loaded into the simulator, the
clock icon is enabled, allowing clock control
Built-in chips:
feature a standard HDL interface yet a Java implementation
Provide behavioral simulation services
May feature GUI effects (at the simulator level only).
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 10
Random Access Memory (RAM) HW
simulator
demo
o Read logic
o Write logic.
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 11
RAM interface
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 12
RAM anatomy
Recursive ascent
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 13
Counter
Needed: a storage device that can:
(a) set its state to some base value
(b) increment the state in every clock cycle
(c) maintain its state (stop incrementing) over clock cycles
(d) reset its state
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 14
Recap: Sequential VS combinational logic
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 15
Time matters
During a tick-tock cycle, the internal states of all the clocked chips are allowed
to change, but their outputs are “latched”
At the beginning of the next cycle, the outputs of all the clocked chips in the
architecture commit to the new values.
Implications:
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 16
Perspective
Disk
But ... real memory units are highly optimized, using a great variety of storage
technologies.
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 17
End notes: some poetry about the limits of logic ...
There exists a field where things are neither true nor false;
I’ll meet you there. (Rumi)
Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org , Chapter 3: Sequential Logic slide 18