Cover of Code by Charles Petzold - Business and Economics Book

From "Code"

Author: Charles Petzold
Publisher: Microsoft Press
Year: 2000
Category: Computers

🎧 Free Preview Complete

You've listened to your free 10-minute preview.
Sign up free to continue listening to the full summary.

🎧 Listen to Summary

Free 10-min Preview
0:00
Speed:
10:00 free remaining
Chapter 14: Feedback and Flip-Flops
Key Insight 2 from this chapter

R-S and Level-Triggered D-Type Flip-Flops as Memory

Key Insight

Flip-flops are circuits designed to retain information, effectively 'remembering' past states. An example constructed with two NOR gates and feedback demonstrates this: initially, with both switches open, a lightbulb is off. Closing and then opening an upper switch causes the light to turn on and remain lit. Conversely, closing and opening a lower switch turns the light off, and it stays off. This behavior reveals two stable states where the circuit's output depends on the most recent switch action rather than just the current input, a unique characteristic crucial for adding memory to circuits.

The simplest type is the R-S (Reset-Set) flip-flop, featuring Q and Q bar outputs (always opposite states) and S (set Q to 1) and R (reset Q to 0) inputs. If S=1 and R=0, Q becomes 1; if S=0 and R=1, Q becomes 0. When both S and R are 0, the outputs maintain their prior state. However, the input combination of S=1 and R=1 is disallowed because it makes both Q and Q bar 0, violating their complementary relationship. These flip-flops are fundamental for building circuits that need to 'remember' events, such as counters.

A more practical memory unit is the level-triggered D-type flip-flop (or latch), which saves the value of a 'Data' input when a 'Hold That Bit' (or 'Clock') signal is active. Built by augmenting an R-S flip-flop with AND gates and an inverter, it functions as a 1-bit memory. When the Clock is 1, the Q output mirrors the Data input. When the Clock returns to 0, Q retains the last Data value, unaffected by subsequent Data changes. An 8-bit latch, consisting of eight such flip-flops with a common Clock, can store an 8-bit value, enabling more advanced applications like an adding machine that can store an intermediate sum as an input for subsequent additions. A 'Clear' input can force Q to 0, providing a reset capability.

📚 Continue Your Learning Journey — No Payment Required

Access the complete Code summary with audio narration, key takeaways, and actionable insights from Charles Petzold.