Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
shift4.ppt
1. PHY 201 (Blum) 1
Shift registers and Floating
Point Numbers
Chapter 11 in Tokheim
2. PHY 201 (Blum) 2
What are they?
Recall that a register is a small piece of
memory that holds values.
In addition to holding values, a shift
register performs a simple operation on
the values; it moves them to the left or
to the right.
5. PHY 201 (Blum) 5
Register
On the previous slide, the input of a
flip-flop is selected from two possible
choices
The output of the same flip-flop
The data switch above
Recall that selecting from one of two
inputs is done by a 2-to-1 MUX.
The load line serves as the address/select
input.
6. PHY 201 (Blum) 6
When Load is high, we are selecting the data switches to be the
data input. So when we go through a positive edge of the clock,
we are writing the value from the data switches to the register.
7. PHY 201 (Blum) 7
When Load is low, we are selecting the flip-flop’s output to be
the data input. So when we go through a positive clock edge, we
are writing the value from the flip-flop to the flip-flop – thus
keeping the value the same as before (holding).
8. PHY 201 (Blum) 8
Register Shift Register
We can adapt the previous circuit to make a
shift register.
Instead of having one of the two possible inputs
for a flip-flop come from the output of the same
flip-flop, we can change this to having that input
come from an adjacent flip-flop.
Then if when the load input is low and we go
through a positive clock edge, the effect is not to
hold the values of the register but to shift them.
This is part of the lab.
9. PHY 201 (Blum) 9
On the ends
If one shifts from the right to the left, then
the input to the rightmost flip-flop does not
come from an adjacent flip-flop during the
shift operation. There are several options
Data switch input
Always 1
Always 0
Use leftmost output to form a ring
10. PHY 201 (Blum) 10
How are shift registers used?
Modems
Cyclic Redundancy Check (CRC)
Multiplication
Adding floats
11. PHY 201 (Blum) 11
Modems
A modem (Modulator-Demodulator) takes a
signal from a computer and places it on a
transmission line.
A transmitting modem modulates, that is,
converts a digital signal from a computer to a
pseudo-analog signal more appropriate for a
transmission line.
The receiving modem demodulates, that is,
converts the pseudo-analog signal back into
digital form.
12. PHY 201 (Blum) 12
Modems (Cont.)
But the aspect of modems relevant here is
that
The transmitting modem converts parallel data to
serial.
The receiving modem converts serial data into
parallel form.
Inside the computer, data that moves around
as words on parallel cables having a
connection for each bit in the word.
The transmission lines are longer and require
data to be sent serially (one bit at a time).
13. PHY 201 (Blum) 13
Parallel to Serial
1 0 1 0 0
To leave the computer, data
moves into register in parallel,
several bits at once.
Data then moves out of
the register serially, one
bit at a time.
14. PHY 201 (Blum) 14
Serial to Parallel
1 0 1 0 0
To enter the
computer, data
enters the register in
serial, one bit at a
time.
Data then moves out of the
register in parallel.
DEMO!
15. PHY 201 (Blum) 15
Cyclic Redundancy Check
In order to check for errors that may occur
during transmission, the sender calculates a
number, a cyclic redundancy check. The
receiver does the same calculation. If they
agree, then presumably no error occurred in
transmission.
Actually the receiver does a calculation that
includes the sender’s CRC as part of the data
and should get an answer of zero.
It’s easier electronically to see if series of bits
corresponds to zero.
16. PHY 201 (Blum) 16
CRC
Any mathematical operation performed on the
transmitted data could serve as a check.
Another common calculation is summing, then it is
called a checksum.
The calculation should not be time consuming.
Think of CRC as a funny kind of division, the
remainder from the division is the check.
It’s not ordinary division, but a strange kind of
division that is easy to realize electronically.
17. PHY 201 (Blum) 17
CRC = Shift register + XORs
Basically one has a shift register with a few
excluded OR gates inserted in strategic positions.