![Page 1: cs316 section 2: Intro to Logisim + State Machines](https://reader036.vdocuments.net/reader036/viewer/2022082400/56813d3a550346895da6f90d/html5/thumbnails/1.jpg)
cs316 section 2: Intro to Logisim + State Machines
• Most real-world hardware design is done using a text-based hardware description language – VHDL, AHDL, etc. – Schematics can be "compiled" into a text description
– Can use a simulator to test the circuit
– Other back-end tools optimize, perform layout and wire routing, floorplan, etc.
– Final spec is either downloaded onto a programmable device, or etched into silicon
• We will be using Logisim for all hardware design– interactive, graphical schematic editor
– educational use mainly (makes it user-friendly)
![Page 2: cs316 section 2: Intro to Logisim + State Machines](https://reader036.vdocuments.net/reader036/viewer/2022082400/56813d3a550346895da6f90d/html5/thumbnails/2.jpg)
SR Latch
• Set-Reset (S-R) Latch• Q: Stored value and its
complement
• S=1 and R=1 ?
S
RQ
Q
QQ00
??1101011010
QQRS
![Page 3: cs316 section 2: Intro to Logisim + State Machines](https://reader036.vdocuments.net/reader036/viewer/2022082400/56813d3a550346895da6f90d/html5/thumbnails/3.jpg)
First Attempt
• How does the output behave?
S
R
D
clk
D
clk
Q
Q
Q
Q
D Q
Q
![Page 4: cs316 section 2: Intro to Logisim + State Machines](https://reader036.vdocuments.net/reader036/viewer/2022082400/56813d3a550346895da6f90d/html5/thumbnails/4.jpg)
Master-Slave Flip-Flop
• Outputs change only on falling edges
• Data is captured on rising edges
• Delay in outputs– but works out
perfectly – data for the next stage is ready half cycle ahead of time
D Q
Q
D Q
Q
clk
D
X
Q
X
![Page 5: cs316 section 2: Intro to Logisim + State Machines](https://reader036.vdocuments.net/reader036/viewer/2022082400/56813d3a550346895da6f90d/html5/thumbnails/5.jpg)
Traffic Light… ?
![Page 6: cs316 section 2: Intro to Logisim + State Machines](https://reader036.vdocuments.net/reader036/viewer/2022082400/56813d3a550346895da6f90d/html5/thumbnails/6.jpg)
Simple intersection
• One non-red light at a time
• Always transition to yellow before red
• Minimum ~10 seconds on green
• ~5 seconds on yellow
• If car sensed at red light… then change directions
• Always complete change-of-direction
• Stay green if no cars sensed
NS EW
S_NS S_EW
![Page 7: cs316 section 2: Intro to Logisim + State Machines](https://reader036.vdocuments.net/reader036/viewer/2022082400/56813d3a550346895da6f90d/html5/thumbnails/7.jpg)
Optimize for minimum effort