Registers, counters and memory
แนะนำใหม่
8:05
การออกแบบตรรกะดิจิทัล
Digital logic needs only two voltage levels, a handful of gates, and time. A three-input function has just eight rows, so checking every row is free, on paper…
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| register/ˈredʒɪstə/ | รีจิสเตอร์ |
| shift register/ʃɪft ˈredʒɪstə/ | รีจิสเตอร์เลื่อน |
| memory/ˈmeməri/ | หน่วยความจำ |
| clock/klɒk/ | A regular square-wave signal that tells a digital circuit when to update. |
| synchronous counter/ˈsɪŋkrənəs ˈkaʊntə/ | เคาน์เตอร์แบบซิงโครนัส |
| ripple counter/ˈrɪpl ˈkaʊntə/ | เคาน์เตอร์แบบripple |
| address lines/əˈdres laɪnz/ | เส้นที่อยู่ |
7, จากนั้น 8
- ตารางคะแนนจะเปลี่ยนจาก 7 เป็น 8 ในขณะที่หลักอื่นๆ อยู่นิ่งๆ นั่นคือการอัปเดตรีจิสเตอร์ และการนับคือรีจิสเตอร์ที่อัปเดตตัวเอง
- บทเรียนนี้สร้างบล็อกจัดเก็บข้อมูลของคอมพิวเตอร์: รีจิสเตอร์, รีจิสเตอร์เลื่อน, ตัวนับ และหน่วยความจำ
รีจิสเตอร์โหลดบิต n บิตพร้อมกัน
- รีจิสเตอร์ คือแถวของ D flip-flop ที่แบ่งปันนาฬิกาเดียวกัน ในแต่ละขอบเขตทุก $n$ บิตจะถูกโหลดพร้อมกัน; ระหว่างขอบเขตพวกมันจะคงค่าไว้
- อินพุต load-enable เลือกว่าในแต่ละขอบเขตจะรับข้อมูลใหม่หรือเก็บข้อมูลเก่าไว้ นั่นคือวิธีที่หลักหนึ่งเปลี่ยนแปลงในขณะที่อีกหลายหลักยังคงนิ่งอยู่
In a register with load-enable low, the stored bits follow the data inputs at each clock edge.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
With load-enable low each flip-flop is fed its own output, so it keeps its value. Only an enabled edge loads new data.
รีจิสเตอร์เลื่อนเคลื่อนย้ายบิตไปข้างหน้า
- ใน รีจิสเตอร์เลื่อน เอาต์พุตของแต่ละ flip-flop จะเชื่อมต่อกับอินพุตของตัวถัดไป ทำให้บิตที่จัดเก็บเคลื่อนที่หนึ่งตำแหน่งต่อรอบนาฬิกา
- Serial in, parallel out แปลงสตรีมบิตเป็นคำ; parallel in, serial out ทำในทางกลับกัน การเลื่อนขวาด้วยอินพุต 1, 1, 0, 1 ให้ผลลัพธ์เป็น 1000, 1100, 0110, 1011
One clock edge moves every stored bit
$Q^{+}=\{sin,Q_3,Q_2,Q_1\}$
Starting from 0000, clock the lesson’s right-shift input stream 1, 1, 0, 1 to get 1000, 1100, 0110, 1011. Follow each old bit to its new position, and distinguish selecting the next input from clocking it into storage.
A 4-bit right-shift register starts at 0000. Inputs 1, 0, 0, 1 enter at the left over four clocks. What does it hold?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Trace: 1000, 0100, 0010, 1001. The first bit in has moved furthest right.
ตัวนับrippleและซิงโครนัส
- ตัวนับripple เชื่อมต่อ toggle flip-flops ต่อเนื่องกัน: เอาต์พุตแต่ละตัวจะสั่งงานนาฬิกาให้กับตัวถัดไป มีความง่าย แต่แต่ละขั้นตอนเพิ่มเวลาหน่วงทำให้บิตบนสุด_schedulerช้าลง
- ตัวนับซิงโครนัส สั่งงานนาฬิกาให้ทุก flip-flop จากขอบเขตเดียวกันและคำนวณว่าบิตใดจะท็อกเกิลด้วยลอจิก ทุกบิตจะเปลี่ยนแปลงพร้อมกัน


In a synchronous counter all the flip-flops receive the same clock edge.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
That is the definition. Logic decides which bits toggle, so all bits change together and no delay accumulates, unlike a ripple counter.
ตัวอย่างที่แสดงวิธีทำ: ตัวนับขึ้น-3-บิต
- Bit 0 toggles every clock; bit 1 when $Q_{0} = 1$; bit 2 when $Q_{1} Q_{0} = 11$. A bit toggles when every bit below it is 1, which is how adding 1 carries.
- หลังรีเซ็ตจะนับ 000, 001, …, 111 และวนกลับไปที่ 000: $2^{3} = 8$ สถานะ
In a 3-bit synchronous up-counter, bit 2 toggles when —
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Bit k toggles when all lower bits are 1, which is when they roll over. The count 000 … 111 with $2^{3} = 8$ states is the check.
ตัวอย่างที่แสดงวิธีทำ: ตัวนับmod-6
- Counter แบบซิงโครนัส mod-6 ทำงานจาก 000 ไปยัง 101; ขอบ clock ถัดจาก 101 จะเขียน 000 รหัส 110 และ 111 ไม่ได้ใช้ในกระบวนการนับปกติ
- เลือกสถานะถัดไป 000 เมื่อคำปัจจุบันคือ 101, 110 หรือ 111; ในกรณีอื่นเพิ่ม 1 สิ่งนี้ยังกู้คืนจากรหัสที่ไม่ใช้ทั้งสองที่ขอบถัดไป $Q_{2} \cdot Q_{1}$ ตรวจจับ 110 และ 111, แต่มันคือ 0 ที่ 101, ดังนั้นเงื่อนไขเพียงอย่างเดียวนี้ไม่ทำให้ counter ซิงโครนัสนี้สมบูรณ์
Predict the toggles, then clock the new count
$Q^{+}=Q\oplus T$
Trace the 3-bit counter’s eight states and see why each bit toggles when all lower old bits are 1. Compare synchronous mod-6, where 101 goes directly to 000. Load either unused code 110 or 111 and check recovery at the next clock edge.
A synchronous mod-6 counter writes 000 at the clock edge after 101, and must also recover from the unused codes. Which present states should load 000?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The edge after 101 must give 000, so 101 is in the set; adding the unused 110 and 111 makes the counter recover from them too. $Q_{2} \cdot Q_{1}$ is 0 at 101, so the count would step on to 110. $Q_{2}$ alone would also clear 100.
A mod-10 counter is built from binary flip-flops. How many of its codes are unused?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Ten states need 4 flip-flops ($2^{4} = 16$), leaving $16 - 10 = 6$ unused codes: 1010 to 1111.
หน่วยความจำ : คำและเส้นที่อยู่
- หน่วยความจำ คือ array ของคำ ด้วย $k$ เส้นนำทาง, มันเลือกหนึ่งจาก $2^{k}$ คำ, แต่ละคำกว้าง $m$ บิต
- หน่วยความจำ 8K × 8 เก็บ $8192 = 2^{13}$ คำที่มีขนาด 8 บิต: มี 13 เส้นที่อยู่และ 8 เส้นข้อมูล
An 8K × 8 memory needs how many address lines?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
$k$ address bits select one of $2^{k}$ words: $8192 = 2^{13}$, so 13 lines. The 8 is the word width (data lines), not the address.
ข้อผิดพลาดทั่วไปสามประการ
- การเชื่อถือเคาน์เตอร์ripple ที่ความเร็วสูง ดูปกติเมื่อช้าแต่ล้มเหลวที่นาฬิกาที่กำหนด เพราะความล่าช้าสะสมกัน
- การเพิกเฉยต่อสถานะที่ไม่ได้ใช้ เคาน์เตอร์ mod-N ต้องกู้คืนจากโค้ดที่ผิดกฎหมายหลังเปิดเครื่องหรือมีสัญญาณรบกวน
- การสับสนระหว่างความกว้างของที่อยู่และข้อมูล ใน 8K × 8, ค่า 8K กำหนดเส้นที่อยู่และ 8 เป็นขนาดคำ
สรุปทบทวน
- Registers load on a shared edge; shift registers move bits one place per clock.
- เคาน์เตอร์ซิงโครนัสเปลี่ยนบิตเมื่อบิตต่ำกว่าทั้งหมดเป็น 1; เคาน์เตอร์ mod-N ต้องจัดการกับโค้ดที่ไม่ได้ใช้
- $k$ เส้นที่อยู่เลือก $2^{k}$ คำ
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้