27 / 36 · Khái niệm
State changes in a shift register
Move the previous bits and insert the new input.
Bài học miễn phí. Đăng ký để lưu tiến độ học tập.
Chưa có bản dịch. Nội dung bài học gốc được hiển thị. (English)
Insert a new bit and move the old ones
A shift register moves bits by one position at a clock edge. This example feeds a serial input, din, into a three-bit register q.
q <= {q[1:0], din}; concatenates the previous two low bits with din. The old q[2] is discarded, and din becomes the new q[0].
After reset to 000, input bits 1, 0, 1, 1 produce 001, 010, 101, 011. Each edge computes from the value before the update.
| Previous q | din | New q |
|---|---|---|
| 000 | 1 | 001 |
| 001 | 0 | 010 |
| 010 | 1 | 101 |
| 101 | 1 | 011 |
With q=101 and din=1, which bits remain and which bit is discarded?
✓ Đã học