Professional Documents
Culture Documents
Logic Gates,Registers
&Memories
1
An introduction to logic
gates and their uses
Opening and closing gates
A gate is a
simple
electronic
circuit that
has a single
output voltage
that
corresponds to
one of the two
binary values.
An introduction to logic
gates and their uses
What decides the output voltage?
28
Registers and memories.
A flip-flop or bistable
29
Registers and memories.
Why do we have to wait?
• When we apply a voltage to a length of wire,
we would hope that the voltage changes as in
Figure 6.2.Unfortunately, it takes a few
nanoseconds to settle down.
• The rise of voltage travels along the
connecting wire and is reflected from the end
causing another voltage to be reflected
towards the input.
30
Registers and memories.
31
Registers and memories.
Why do we have to wait? The voltage to stabilize.
32
Registers and memories.
And what about the clock signal?
• This is just an input to tell the flip-flop that it is
time to read the input level. All microprocessor
operations are carefully timed by clock pulses to
ensure that the system operates in the correct
sequence.
• The clock signal is usually a positive-going voltage
pulse. This pulse can be used to switch two
circuits at different times by designing one circuit
to respond to an increasing voltage and the other
to use a decreasing voltage.
33
Registers and memories.
34
Registers and memories.
A register
• A register is just a collection of flip-flops. A
flip-flop can only store one bit so to handle 32
bits at a time we would need 32 flip-flops and
would refer to this as a 32-bit register.
35
Registers and memories.
• The register has two distinct groups of
connections: the data bits 0 to 7 and the
control signals.
• The data connections or data lines carry the
binary levels in or out of the register.
• The number of data lines determines the size
of the register so a 64-bit register would have
64 data connections.
36
Registers and memories.
37
Registers and memories.
How long can it be stored?
• It will be stored until the power supplies are
removed – either by an equipment fault or,
more usually, by the system being switched
off.The data does not deteriorate in storage.
38
Registers and memories.
Shift registers
• These are a variation on the register theme.
They still consist of group of flip-flops but the
interconnections have been changed. Have a
look at the arrangement in Figure 6.7 and see
if you can guess the likely outcome.
39
Registers and memories.
• In Figure 6.8, the register has been loaded
with the binary equivalent of 3610 or 24H and
a series of zeros has been chosen to be loaded
at the bit 0 end.
40
Registers and memories.
41
Registers and memories.
• Follow the sequence through and in particular
note what happens to the numbers stored:
1. After one clock pulse, all the bits will have
moved one place to the left. A new ‘0’ will
have entered bit 0 and the last, which was in
bit 7, will have fallen off the end of the world.
The bits stored at this time are 01001000 and
the numerical value is 48H or, in denary,
7210. Notice how shifting the bits to the left
has multiplied the value by 2. 42
Registers and memories.
2. After eight clock pulses, all the existing data in
the register will have been flushed out and
refilled with zeros. The register will hold the
number zero so there is a limit to how many
times we can multiply by shifting the register.
3. After 5000 clock pulses, it is still full of zeros.
Admittedly, they will be new zeros that have
replaced the others but that will not make
any difference.
43
Registers and memories.
44
Registers and memories.
• This is called a shift register because the data
is shifted from one flipflop to the next each
time the clock pulse occurs. Specifically, the
one shown is a shift left register because each
bit moves one place to the left on each clock
pulse. All the bits move at the same time. The
last one in bit 7 drops off the end and is lost
while at the other end, a new bit is entered
into bit 0.
45
Registers and memories.
Rotate registers
46
Registers and memories.
Memories.
• The function of a memory is to store
information – almost the same as we said for
the register. Generally, a register lives within
the microprocessor and stores small quantities
of data for immediate use and it can do useful
little tricks like shift and rotate. A memory is
designed for bulk storage of data but that is all
it can do – no tricks this time.
47
Registers and memories.
• RAM or volatile memory.
• ROM or non-volatile memory (volatile means
‘able to evaporate’).
48
Registers and memories.
49
Registers and memories.
• Each location in a memory is given a number,
called an address. In Figure 6.14, the 16
locations of memory would be numbered
from 0 to 15, or in binary 0000–11112. The
cells are formed into a rectangular layout, in
this case a 4 4 square with four columns and
four rows.
50
Registers and memories.
51
Registers and memories.
Two types of RAM
• Ram chips can be designed in two different
forms which we call static RAM (SRAM) and
dynamic RAM (DRAM),
• Static RAM
• These are constructed of flip-flops. The
problem with the flip-flop is that it draws
current all the time. Therefore, it tends to get
rather warm
52
Registers and memories.
53
Registers and memories.
Masked ROM
• A masked ROM is manufactured to our
specification and cannot be changed. We must
be very sure that the information is correct
before it is made otherwise it all goes in the
waste bin.
54
Registers and memories.
55
Registers and memories.
• Programmable ROM (PROM)
• Erasable programmable ROM (EPROM)
• Electrically erasable programmable ROM
(EEPROM)
56
Registers and memories.
• Pin layout of an EPROM
57
Registers and memories.
Power supplies
• The main power supplies to operate the chip are
the +5 V applied to the V+ pin and 0 V on the
GND (ground) pin.
Address pins
• Address pins are always numbered starting from
A0. We have seen that the number of location is
given by 2n so with 17 address lines (A0 to A16)
the number of locations would be 217 = 131 072.
58
Registers and memories.
Control pins
1. Chip enable (CE), sometimes called chip select (CS), is the main on/
off switch for the chip. It is usually active low, which means that the
chip needs a logic 0 voltage to be applied to switch the chip on. This
is indicated by a line over the CE. When the chip is switched off, it
goes to sleep and the power drops with a reduction of about 150
times.
2 Output enable (OE) leaves the chip fired up but with its output
disconnected from the data pins. This is done by disabling a series
of tri-state buffers immediately before the data pins. Disconnecting
the output pins is very much faster than switching the chip off.
Watch out for the line over the name to indicate the polarities
required.
59
Registers and memories.
Unconnected pins
• These are shown as NC and are not used. They
are physically separate from the internal chip
and therefore have no effect of anything. They
should be left unconnected.
60
Registers and memories.
61