UNIT V Notes
UNIT V Notes
INTRODUCTION
Memory Unit
• A memory unit is a device to which binary information is transferred for storage and
from which information is retrieved when needed for processing.
• When data processing takes place, information from memory is transferred to selected
registers in the processing unit.
• Intermediate and final results obtained in the processing unit are transferred back to
be stored in memory.
• Binary information received from an input device is stored in memory, and
information transferred to an output device is taken from memory.
• A memory unit is a collection of cells capable of storing a large quantity of binary
information.
Types of memories
There are two types of memories that are used in digital systems:
• Random‐Access Memory (RAM)
• Read‐Only Memory (ROM)
RAM
• RAM stores new information for later use.
• The process of storing new information into memory is referred to as a memory write
operation.
• The process of transferring the stored information out of memory is referred to as a
memory read operation.
• RAM can perform both write and read operations.
ROM
• ROM can perform only the read operation.
• This means that suitable binary information is already stored inside memory and can
be retrieved or read at any time.
• However, that information cannot be altered by writing.
PLD(Programmable Logic Device)
• A PLD is an integrated circuit with internal logic gates connected through electronic
paths that behave similarly to fuses.
• The binary information that is stored within such a device is specified in some fashion
and then embedded within the hardware in a process is referred to as programming
the device.
• The word “programming” here refers to a hardware procedure which specifies the bits
that are inserted into the hardware configuration of the device.
• In the original state of the device, all the fuses are intact.
• Programming the device involves blowing those fuses along the paths that must be
removed in order to obtain the particular configuration of the desired logic function.
• A typical PLD may have hundreds to millions of gates interconnected through
hundreds to thousands of internal paths.
Examples of PLD
• ROM -OR
• Programmable Logic Array (PLA) AND - OR
• Programmable Array Logic (PAL) AND
• Field‐Programmable Gate Array (FPGA)
Conventional and array logic diagrams for OR gate
I.RANDOM-ACCESS MEMORY
• A memory unit is a collection of storage cells, together with associated circuits needed
to transfer information into and out of a device.
• The architecture of memory is such that information can be selectively retrieved from
any of its internal locations.
• The time it takes to transfer information to or from any desired random location is
always the same—hence the name random‐access memory, abbreviated RAM.
• In contrast, the time required to retrieve information that is stored on magnetic tape
depends on the location of the data.
• A memory unit stores binary information in groups of bits called words .
• Data is transferred into and out of memory in terms of words.
• A memory word is a group of 1’s and 0’s and may represent a number, an instruction,
one or more alphanumeric characters, or any other binary‐coded information.
• A group of 8 bits is called a byte .
• 16‐bit word contains two bytes,
• 32‐bit word is made up of four bytes.
• The capacity of a memory unit is usually stated as the total number of bytes that the
unit can store.
• Communication between memory and its environment is achieved through data input
and output lines, address selection lines, and control lines that specify the direction of
transfer.
Write Operations
1. Apply the binary address of the desired word to the address lines.
2. Apply the data bits that must be stored in memory to the data input lines.
3. Activate the write input.
The memory unit will then take the bits from the input data lines and store them in the
word specified by the address lines.
Read Operations
1. Apply the binary address of the desired word to the address lines.
2. Activate the read input.
The memory unit will then take the bits from the word that has been selected by the
address and apply them to the output data lines.
Types of Memories
• Static RAM (SRAM)
• Dynamic RAM (DRAM)
Static RAM (SRAM)
• Static RAM (SRAM) consists essentially of internal latches that store the binary
information.
• The stored information remains valid as long as power is applied to the unit.
Dynamic RAM (DRAM)
• Dynamic RAM (DRAM) stores the binary information in the form of electric charges
on capacitors provided inside the chip by MOS transistors.
• The stored charge on the capacitors tends to discharge with time, and the capacitors
must be periodically recharged by refreshing the dynamic memory.
• Refreshing is done by cycling through the words every few milliseconds to restore
the decaying charge.
SRAM Vs DRAM
• DRAM offers reduced power consumption and larger storage capacity in a single
memory chip.
• SRAM is easier to use and has shorter read and write cycles.
Volatile Vs Non-volatile memory
• Memory units that lose stored information when power is turned off are said to be
volatile .
• RAM-volatile
• A nonvolatile memory, such as magnetic disk, retains its stored information after the
removal of power.
• ROM – non-volatile
Masked ROM
Programmable ROM
Erasable PROM
Electrically EPROM
2kxn RAM
Memory with 2k words of n bits per word requires: k address lines that go into a k * 2k
decoder.
4x4 RAM 22x4 RAM
2 address lines that go into a 2* 22 decoder.
0 0 0 1 1
0 0 1 0 2
0 0 1 1 3
0 1 0 0 4
0 1 0 1 5
0 1 1 0 6
0 1 1 1 7
1 0 0 0 8
1 0 0 1 9
1 0 1 0 10
1 0 1 1 11
1 1 0 0 12
LSB=1,3,5,7,9,11
Next BIT=2,3,6,7,10,11
Next Bit=4,5,6,7,12
MSB=8,9,10,11,12
P1=XOR(3,5,7,9,11)=XOR(1,1,0,0,0)=0
P2=XOR(3,6,7,10,11)=XOR(1,0,0,1,0)=0
P4=1
P8=1
1 2 3 4 5 6 7 8 9 10 11 12
0 0 1 1 1 0 0 1 0 1 0 0
• LSB=1,3,5,7,9,11
• Next BIT=2,3,6,7,10,11
• Next Bit=4,5,6,7,12
• MSB=8,9,10,11,12
• After reading 12 bits they are checked for errors
• Check bits:
• C1=XOR(1,3,5,7,9,11)=XOR(0,1,1,0,0,0)=0
• C2=XOR(2,3,6,7,10,11)=0
• C4=XOR(4,5,6,7,12)=0
• C8=XOR(8,9,10,11,12)=0
• c1C2C4C8=0000 no error
• C=C1C2C4C8not equal to 0 ,an error
• If check bit=0 ,designates even parity
• If check bit=1 ,designates odd parity
• If c≠0, The 4-bit binary number gives position of erroneous bit, correct the error by
complementing the corresponding bit.
• C=C1C2C4C8 = 0101=5 error in position 5
Single‐Error Correction, Double‐Error Detection
• The Hamming code can detect and correct only a single error.
• By adding another parity bit to the coded word, the Hamming code can be used to
correct a single error and detect double errors.
• 8‐bit data word 11000100 (n=8)
• Let k=5
• n+k=8+5=13 bits
1 2 3 4 5 6 7 8 9 10 11 12 13
P1 P2 1 P4 1 0 0 P8 0 1 0 0 P13
• The inputs provide the address for memory, and the outputs give the data bits of the
stored word that is selected by the address.
• The number of words in a ROM is determined from the fact that k address input lines
are needed to specify 2k words.
• In general, a 2k * n ROM will have an internal k * 2k decoder and n OR gates.
• 32x8 ROM
• 25x8 ROM k=5,n=8
• 5x32 Decoder
• 8 OR gates
• The 256 intersections are programmable.
• A programmable connection between two lines is logically equivalent to a switch that
can be altered to be either closed (meaning that the two lines are connected) or open
(meaning that the two lines are disconnected).
• The programmable intersection between two lines is sometimes called a crosspoint .
• The internal binary storage of a ROM is specified by a truth table .
• The hardware procedure that programs the ROM blows fuse links in
accordance with a given truth table.
• Every 0 listed in the truth table specifies the absence of a connection, and
every 1 listed specifies a path that is obtained by a connection.
Combinational Circuit Implementation
• A ROM has a decoder generates the 2k minterms of the k input variables.
• By inserting OR gates to sum the minterms of Boolean functions, we were able to
generate any desired combinational circuit.
EXAMPLE-1
Design a combinational circuit using a ROM. The circuit accepts a three‐bit number and
outputs a binary number equal to the square of the input number.
Truth Table B1=0,B0=A0 input variables=3,output variables=4
K=3,n=4
2kxn ROM = 2 power 3x4 ROM
A2 A1 A0 B5 B4 B3 B2 B1 B0 decimal
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 1
0 1 0 0 0 0 1 0 0 4
0 1 1 0 0 1 0 0 1 9
1 0 0 0 1 0 0 0 0 16
1 0 1 0 1 1 0 0 1 25
1 1 0 1 0 0 1 0 0 36
1 1 1 1 1 0 0 0 1 49
• 2kxn ROM
• k- number of input variables=3
• n-number of output variables=4
• 8x4 ROM
• 3x8 Decoder 4 OR gates
BLOCK DIAGRAM
x y z A B C D
0 0 0 0 1 0 0
0 0 1 1 1 0 1
0 1 0 0 0 0 1
0 1 1 1 0 1 0
1 0 0 0 0 0 1
1 0 1 1 0 1 1
1 1 0 1 1 0 0
1 1 1 0 1 0 1
Types of ROM
• The required paths in a ROM may be programmed in four different ways.
1. Mask programming: fabrication process
2. Read-only memory or PROM: blown fuse /fuse intact
3. Erasable PROM or EPROM: placed under a special ultraviolet light for a given
period of time will erase the pattern in ROM.
4. Electrically-erasable PROM(EEPROM): erased with an electrical signal instead of
ultraviolet light.
Combinational PLDs
• A combinational PLD is an integrated circuit with programmable gates divided into an
AND array and an OR array to provide an AND-OR sum of product implementation.
• PROM: fixed AND array constructed as a decoder and programmable OR array.
• PAL: programmable AND array and fixed OR array.
• PLA: both the AND and OR arrays can be programmed.