DPSD Unit 5
DPSD Unit 5
proceeding:
This document is confidential and intended solely for the educational purpose of
RMK Group of Educational Institutions. If you have received this document
through email in error, please notify the system manager. This document
contains proprietary information and is intended only to the respective group /
learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender
immediately by e-mail if you have received this document by mistake and delete
this document from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in reliance on
the contents of this information is strictly prohibited.
20CS301 DIGITAL
PRINCIPLES AND
SYSTEM DESIGN
Department: COMPUTER SCIENCE AND ENGINEERING
Batch/Year: BATCH 2020-24/II
Created by:
Dr. S Selvi , Professor, CSE, RMKEC
Ms. K Elavarasi , AP, CSE, RMKEC
1 Online Quiz 50
Lecture Notes – Unit V
UNIT V
MEMORY AND PROGRAMMABLE LOGIC
Sl. No. Contents Page No.
Introduction to Memory
1 12
Read / Write Operations
2 16
Classification of Memory – Types of Memory
3 18
Memory Decoding
Internal construction of RAM
4 33
Coincident Decoding
Address Multiplexing
Error Detection and Correction
5 Parity Bit 41
Hamming Code
ROM
Combinational PLD’s
6 - Programmable ROM (PROM) 50
- Programmable Logic Array (PLA)
- Programmable Array Logic (PAL)
Sequential Programmable Devices.
7 59
Introduction to Memory
• The binary information is transferred for storage and from which information is
available when needed for processing.
• When data processing takes place, information from the 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.
• As a rule, memories store data in units that have from one to eight bits. The
smallest unit of binary data is the bit. In many applications, data are handled in
an 8- bit unit called a byte or in multiples of 8-bit units.
• The byte can be split into two 4-bit units that are called nibbles. A complete unit
of information is called a word and generally consists of one or more bytes.
Some memories store data in 9-bit groups; a 9-bit group consists of a byte plus a
parity bit.
• The location of a unit of data in a memory array is called its address. For
example, in Figure (a), the address of a bit in the 3-dimensional array is specified
by the row and column.
• In Figure (b), the address of a byte is specified only by the row in the 2-
dimensional array. So, as you can see, the address depends on how the memory
is organized into units of data. Personal computers have random-access memories
organized in bytes. This means that the smallest group of bits that can be
addressed is eight.
Introduction to Memory
• The capacity of a memory is the total number of data units that can be stored.
For example, in the bit-organized memory array in Figure (a), the capacity is 64
bits. In the byte-organized memory array in Figure (b), the capacity is 8 bytes,
which is also 64 bits. Computer memories typically have 256 MB (megabyte) or
more of internal memory.
• Since a memory stores binary data, data must be put into the memory and data
must be copied from the memory when needed.
• The write operation puts data into a specified address in the memory, and the
read operation copies data out of a specified address in the memory.
• The addressing operation, which is part of both the write and the read operations,
selects the specified memory address.
Introduction to Memory
• Data units go into the memory during a write operation and come out of the
memory during a read operation on a set of lines called the data bus. As indicated
in Figure, the data bus is bidirectional, which means that data can go in either
directional (into the memory or out of the memory).
• For example, a 15- bit address code can select 32,768 locations (215)
in the memory; a 16-bit address code can select 65,536 locations (216)
in the memory and so on.
Write Operation
• To store a byte of data in the memory, a code held in the address register is
placed on the address bus. Once the address code is on the bus, the address
decoder decodes the address and selects the specified location in the memory.
• The memory then gets a write command, and the data byte held in the data
register is placed on the data bus and stored in the selected memory address,
thus completing the write operation.
• When a new data byte is written into a memory address, the current data byte
stored at that address is overwritten (replaced with a new data byte).
Read Operation
• A code held in the address register is placed on the address bus. Once the
address code is on the bus, the address decoder decodes the address and
selects the specified location in the memory.
• The memory then gets a read command, and a "copy" of the data byte that
is stored in the selected memory address is placed on the data bus and
loaded into the data register, thus completing the read operation.
• When a data byte is read from a memory address, it also remains stored at
Classification of Memories
There are two types of memories that are used in digital systems:
• All RAMs have both read and write capability. Because RAMs lose stored data
when the power is turned off, they are volatile memories.
• The ROM, like the RAM, is a random-access memory but the term RAM
traditionally means a random-access read/write memory. Because ROMs retain
stored data even if power is turned off, they are nonvolatile memories.
Classification of memories
Introduction to Memory
• RAMs are read/write memories in which data can be written into or read from
any selected address in any sequence.
• When a data unit is written into a given address in the RAM, the data unit
previously stored at that address is replaced by the new data unit.
• When a data unit is read from a given address in the RAM, the data unit
remains stored and is not erased by the read operation.
• A RAM is typically used for short-term data storage because it cannot retain
stored data when power is turned off.
• The two categories of RAM are the static RAM (SRAM) and the dynamic RAM
(DRAM).
• Static RAMs generally use flip-flops as storage elements and can therefore store
data indefinitely as long as dc power is applied. Dynamic RAMs use capacitors as
storage elements and cannot retain data very long without the capacitors being
recharged by a process called refreshing.
• Both SRAMs and DRAMs will lose stored data when dc power is removed and,
therefore, are classified as volatile memories.
• Data can be read much faster from SRAMs than from DRAMs. However, DRAMs
can store much more data than SRAMs for a given physical size and cost because
the DRAM cell is much simpler, and more cells can be crammed into a given chip
area than in the SRAM.
Introduction to Memory
• The cell is selected by an active level on the Select line and a data bit (l or 0) is
written into the cell by placing it on the Data in line. A data bit is read by taking it
off the Data out line.
• The memory cells in a SRAM are organized in rows and columns. All the cells
in a row share the same Row Select line.
• Each set of Data in and Data out lines go to each cell in a given column and
are connected to a single data line that serves as both an input and output
(Data I/O) through the data input and data output buffers.
• SRAM chips can be organized in single bits, nibbles (4 bits), bytes (8 bits), or
multiple bytes (16, 24, 32 bits, etc.).
• The memory cell array is arranged in 256 rows and 128 columns, each with 8 bits
as shown below. There are actually 215 = 32,768 addresses and each address
contains 8 bits. The capacity of this example memory is 32,768 bytes (typically
expressed as 32 kbytes).
Introduction to Memory
Operation:
• The SRAM works as follows. First, the chip select, CS, must be LOW for the
memory to operate. Eight of the fifteen address lines are decoded by the row
decoder to select one of the 256 rows. Seven of the fifteen address lines are
decoded by the column decoder to select one of the 128 8-bit columns.
Read:
• In the READ mode, the write enable input, WE‘ is HIGH and the output
enable, OE‗ is LOW.
• The input tristate buffers are disabled by gate G1, and the column output
tristate buffers are enabled by gate G2. Therefore, the eight data bits from
the selected address are routed through the column I/O to the data lines
(I/O1 through I/O7), which are acting as data output lines.
Write:
• In the WRITE mode, WE‘ is LOW and OE‘ is HIGH. The input buffers are
enabled by gate G1, and the output buffers are disabled by gate G2.
• Therefore the eight input data bits on the data lines are routed through the
input data control and the column I/O to the selected address and stored.
• For the read cycle shown in part (a), a valid address code is applied to the
address lines for a specified time interval called the read cycle time, tWC.
• Next, the chip select (CS) and the output enable (DE) inputs go LOW. One-
time interval after the DE input goes LOW; a valid data byte from the
selected address appears on the data lines. This time interval is called the
output enable access time, tGQ.
• Two other access times for the read cycle are the address access time,
tAQ, measured from the beginning of a valid address to the appearance of
valid data on the data lines and the chip enable access time, tEQ,
measured from the HIGH-to-LOW transition of CS to the appearance of valid
data on the data lines.
Introduction to Memory
• During each read cycle, one unit of data, a byte in this case is read from the
memory.
• For the write cycle shown in Figure (b), a valid address code is applied to the
address lines for a specified time interval called the write cycle time, tWE .
Next, the chip select (CS) and the write enable (WE) in puts go LOW.
• The required time interval from the beginning of a valid address until the WE
• The time that the WE input must be LOW is the write pulse width. The time
that the input WE must remain LOW after valid data are applied to the data
inputs is designated t WD; the time that the valid input data must remain on
the data lines after the WE input goes HIGH is the data hold time, t h(D).
• During each write cycle, one unit of data is written into the memory.
Introduction to Memory
• Dynamic memory cells store a data bit in the form of electric charges on
capacitors. The basic storage device in DRAM is not a flip-flop but a simple
MOSFET and a capacitor.
• The advantage of this type of cell is that it is very simple, thus allowing very large
memory arrays to be constructed on a chip at a lower cost per bit.
• The advantage of this type of cell is that it is very simple, thus allowing very large
memory arrays to be constructed on a chip at a lower cost per bit.
• The disadvantage is that the storage capacitor cannot hold its charge over an
extended period of time and will lose the stored data bit unless its charge is
refreshed periodically.
• The DRAM cell includes a single MOS transistor (MOSFET) and a capacitor. When
column line and row line go high, the MOSFET conducts and charges the
capacitor. When the column and row lines go low, the MOSFET opens and the
capacitor retains its charge. In this way it stores 1 bit.
• A ROM stores data that are used repeatedly in system applications, such as tables,
conversions, or programmed instructions for system initialization and operation.
ROMs retain stored data when the power is OFF and are therefore nonvolatile
memories.
Masked ROM
• A PROM uses some type of fusing process to store bits, in which a memory
link is burned open or left intact to represent a 0 or a 1.
changed.
• Two basic types of erasable PROMs are the ultraviolet erasable PROM (UV
EPROM) and the electrically erasable PROM (EEPROM).
EEPROM (Electrically Erasable PROM)
• A PROM uses some type of fusing process to store bits, in which a memory
link is burned open or left intact to represent a 0 or a 1.
changed.
• Two basic types of erasable PROMs are the ultraviolet erasable PROM (UV
EPROM) and the electrically erasable PROM (EEPROM).
EEPROM (Electrically Erasable PROM)
• The EEPROM (Electrically Erasable PROM), also uses MOS circuitry. Data is
stored as charge or no charge on an insulating layer, which is made very thin
(< 200Å). Therefore a voltage as low as 20- 25V can be used to move
charges across the thin barrier in either direction for programming or erasing
ROM.
Introduction to Memory
• It allows selective erasing at the register level rather than erasing all the
information, since the information can be changed by using electrical signals.
• It has chip erase mode by which the entire chip can be erased in 10 msec.
Hence EEPROM‘s are most expensive.
• Advantages of RAM:
1. Fast operating speed (< 150 nsec),
2. Low power dissipation (< 1mW),
3. Economy,
4. Compatibility,
5. Non-destructive read-out.
• Advantages of ROM:
1. Ease and speed of design,
2. Faster than MSI devices (PLD and FPGA)
• Disadvantages of ROM:
• For functions more than 20 inputs, a ROM based circuit is impractical because of
the limit on ROM sizes that are available.
• For simple to moderately complex functions, ROM based circuit may be costly:
consume more power; run slower.
Introduction to Memory
capability.
2 RAMs are volatile memories. ROMs are non-volatile memories.
3 They lose stored data when the They retain stored data even if power is
power is turned OFF. turned off.
4 RAMs are available in both RAMs are available in both bipolar and
bipolar and MOS technologies. MOS technologies.
5 Types: SRAM, DRAM, EEPROM Types: PROM, EPROM.
1 It contains less memory cells It contains more memory cells per unit area.
per unit area.
2 Its access time is less, hence Its access time is greater than static RAM
faster memories.
3 It consists of number of flip- It stores the data as a charge on the capacitor.
flops. Each It consists of MOSFET and capacitor for each
flip-flop cell.
stores
one bit.
4 Refreshing circuitry is Refreshing circuitry is required to maintain
not required. the charge on the capacitors every time after
every few milliseconds. Extra hardware is
required to control refreshing.
SRAM No No No Yes
DRAM No Yes Yes Yes
ROM Yes Yes Yes No
EPROM Yes Yes Yes No
EEPROM Yes No No Yes
Memory Decoding
• To be able to include the entire memory in one diagram, the memory unit
presented here has a small capacity of 16 bits, arranged in four words of 4 bits
each.
Internal Construction
• The internal construction of a RAM of m words and n bits per word consists of
m * n binary storage cells and associated decoding circuits for selecting individual
words.
Introduction to Memory
• The binary storage cell is the basic building block of a memory unit. The
equivalent logic of a binary cell that stores one bit of information is shown in the
following Figure.
• The storage part of the cell is modelled by an SR latch with associated gates to
form a D latch. Actually, the cell is an electronic circuit with four to six transistors.
Nevertheless, it is possible and convenient to model it in terms of logic symbols.
• A binary storage cell must be very small in order to be able to pack as many cells
as possible in the small area available in the integrated circuit chip.
• The binary cell stores one bit in its internal latch. The select input enables the cell
for reading or writing, and the read/write input determines the operation of the
cell when it is selected. A ‘1’ in the read/write input provides the read operation
by forming a path from the latch to the output terminal. A ‘0’ in the read/write
input provides the write operation by forming a path from the input terminal to
the latch.
Memory cell
Introduction to Memory
• The logical construction of a small RAM is shown in the following figure . This
RAM consists of four words of four bits each and has a total of 16 binary cells.
The small blocks labelled BC represent the binary cell with its three inputs and
one output.
• A memory with four words needs two address lines. The two address inputs go
through a 2 * 4 decoder to select one of the four words.
• The decoder is enabled with the memory‐enable input. When the memory enable
is 0, all outputs of the decoder are 0 and none of the memory words are selected.
With the memory select at 1, one of the four words is selected, dictated by the
value in the two address lines.
• Once a word has been selected, the read/write input determines the operation.
During the read operation, the four bits of the selected word go through OR gates
to the output terminals.
• During the write operation, the data available in the input lines are transferred
into the four binary cells of the selected word. The binary cells that are not
selected are disabled, and their previous binary values remain unchanged.
• When the memory select input that goes into the decoder is equal to 0, none of
the words are selected and the contents of all cells remain unchanged regardless
of the value of the read/write input.
• Commercial RAMs may have a capacity of thousands of words, and each word
may range from 1 to 64 bits. The logical construction of a large‐capacity memory
would be a direct extension of the configuration shown here.
Introduction to Memory
• A memory with 2k words of n bits per word requires k address lines that go into a
k * 2k decoder. Each one of the decoder outputs selects one word of n bits for
reading or writing.
• A memory with four words needs two address lines. The two address inputs go
through a 2 * 4 decoder to select one of the four words.
Diagram of a 4 * 4 RAM
Coincident Decoding
• A decoder with k inputs and 2k outputs requires 2k AND gates with k inputs per
gate. The total number of gates and the number of inputs per gate can be
reduced by employing two decoders in a two‐dimensional selection scheme.
• In this configuration, two k /2‐input decoders are used instead of one k ‐input
decoder. One decoder performs the row selection and the other the column
selection in a two‐dimensional matrix configuration.
• The five most significant bits of the address go to input X and the five least
significant bits go to input Y. Each word within the memory array is selected by
the coincidence of one X line and one Y line.
• As an example, consider the word whose address is 404. The 10‐bit binary
equivalent of 404 is 01100 10100. This makes X = 01100 (binary 12) and Y =
10100 (binary 20).
• The n ‐bit word that is selected lies in the X decoder output number 12 and the Y
decoder output number 20. All the bits of the word are selected for reading or
writing.
Introduction to Memory
Address Multiplexing
• The SRAM memory cell typically contains six transistors. In order to build
memories with higher density, it is necessary to reduce the number of transistors
in a cell.
• The DRAM cell contains a single MOS transistor and a capacitor. The charge
stored on the capacitor discharges with time, and the memory cells must be
periodically recharged by refreshing the memory.
• Because of their simple cell structure, DRAMs typically have four times the density
of SRAMs. This allows four times as much memory capacity to be placed on a
given size of chip.
Introduction to Memory
• The cost per bit of DRAM storage is three to four times less than that of SRAM
storage. A further cost savings is realized because of the lower power
requirement of DRAM cells.
• These advantages make DRAM the preferred technology for large memories in
personal digital computers. DRAM chips are available in capacities from 64K to
256M bits.
• Most DRAMs have a 1‐bit word size, so several chips have to be combined to
produce a larger word size.
• There is a single data input line, a single data output line, and a read/write
control, as well as an eight‐bit address input and two address strobes, the latter
included for enabling the row and column address into their respective registers.
• The row address strobe (RAS) enables the eight‐bit row register, and the column
address strobe (CAS) enables the eight‐bit column register.
• The bar on top of the name of the strobe symbol indicates that the registers are
enabled on the zero level of the signal.
• The 16‐bit address is applied to the DRAM in two steps using RAS and CAS.
Initially, both strobes are in the 1 state. The 8‐bit row address is applied to the
address inputs and RAS is changed to 0.
• This loads the row address into the row address register. RAS also enables the
row decoder so that it can decode the row address and select one row of the
array. After a time, equivalent to the settling time of the row selection, RAS goes
back to the 1 level.
• The 8‐bit column address is then applied to the address inputs, and CAS is driven
to the 0 state.
• This transfers the column address into the column register and enables the
column decoder. Now the two parts of the address are in their respective
registers, the decoders have decoded them to select the one cell corresponding to
the row and column address, and a read or write operation can be performed on
that cell. CAS must go back to the 1 level before initiating another memory
operation.
Introduction to Memory
Solution:
• The 8 input data lines go to all the chips. The outputs must be ORed together, to
form the common 8 output data lines. The 4k word memory requires a 12-bit
address. The 10 least significant bits of the address are applied to the address
inputs of all four chips.
• The other two most significant bits are applied to a 2*4 decoder. The four outputs
of the decoder are applied to the CS inputs of each chip. The memory is disabled
when the memory enable input of the decoder is equal to 0. This causes all the
four outputs of the decoder to be in the 0 state and none of the chips are
selected.
Introduction to Memory
Solution:
• The 16 input and output data lines are split between the two chips. Both receive
the same 10-bit address and the common CS and RW control inputs.
1. Obtain the 12‐bit Hamming code word for the 8‐bit data word
11000100.
Solution
•The 4 parity bits, P1, P2, P4, and P8, are in positions 1, 2, 4, and 8, respectively.
•The 8 bits of the data word are in the remaining positions. Each parity bit is
calculated as follows:
•The exclusive‐OR (XOR) operation performs the odd function: It is equal to 1 for an
odd number of 1’s in the variables and to 0 for an even number of 1’s. Thus, each
parity bit is set so that the total number of 1’s in the checked positions, including the
parity bit, is always even.
2. ERROR CORRECTION SCHEME – HAMMING CODE
1. Obtain the 12‐bit Hamming code word for the 8‐bit data word 11000100.
•The 8‐bit data word is stored in memory together with the 4 parity bits as a 12‐bit composite
word. Substituting the 4 P bits in their proper positions, we obtain the 12‐bit composite word
stored in memory:
•Therefore, the 12‐bit Hamming code word for the 8‐bit data word 11000100, calculated is,
001110010100
2. ERROR CORRECTION SCHEME – HAMMING CODE
2. Obtain the 15‐bit Hamming code word for the 11‐bit data word 11001001010.
Solution
Solution
We include 4 parity bits P1, P2 , P4 , P8 with the 11‐bit word and arrange the 15 bits as follows:
• The 4-parity bits, P1, P2 , P4 , and P8, are in positions 1, 2, 4, and 8, respectively.
• The 11-bits of the data word are in the remaining positions.
• Each parity bit is calculated as follows:
• The exclusive‐OR (XOR) operation performs the odd function: It is equal to 1 for an odd
number of 1’s in the variables and to 0 for an even number of 1’s. Thus, each parity bit is
set so that the total number of 1’s in the checked positions, including the parity bit, is
always even.
2. ERROR CORRECTION SCHEME – HAMMING CODE
2. Obtain the 15‐bit Hamming code word for the 11‐bit data word 11001001010.
•The 11‐bit data word is stored in memory together with the 4 parity bits as a 15‐bit composite
word. Substituting the 4 P bits in their proper positions, we obtain the 15‐bit composite word
stored in memory:
•Therefore, the 15‐bit Hamming code word for the 11‐bit data word 11001001010, calculated
is,
101 110 011 001 010
2. ERROR CORRECTION SCHEME – HAMMING CODE
3. A 12‐bit Hamming code word containing 8 bits of data and 4 parity bits
is read from memory. What was the original 8‐bit data word that was
written into memory if the 12‐bit word read out is as follows:
Solution
•The 12‐bit Hamming code word containing 8 bits of data and 4 parity bits given is,
(a) 001110010100
(b) 101110010100
(c) 001100010100
• When the 12 bits are read from memory, they are checked again for errors. The
parity is checked over the same combination of bits, including the parity bit.
•The original 8-bit data word can be retrieved after the 4 check bits are evaluated as
follows:
3. A 12‐bit Hamming code word containing 8 bits of data and 4 parity bits is
read from memory. What was the original 8‐bit data word that was written into
memory if the 12‐bit word read out is as follows:
•In b) C = C8C4C2C1 = 0001, indicates error in bit 1. But the given 12-bit Hamming
word is 101110010100. Since there is an error in bit 1 (as computed C = 0001, is bit 1),
it has to be inverted. Therefore the correct 12-bit Hamming code is, 001110010100.
Therefore, the original data word is, 11000100.
•In c) C = C8C4C2C1 = 0101, indicates error in bit 5. But the given 12-bit Hamming
word is 001100010100. Since there is an error in bit 5 (as computed C = 0101, is bit 5), it
has to be inverted. Therefore the correct 12-bit Hamming code is, 001110010100.
Therefore, the original data word is, 11000100.
2. ERROR CORRECTION SCHEME – HAMMING CODE
4. A 12‐bit Hamming code word containing 8 bits of data and 4 parity bits
is read from memory. What was the original 8‐bit data word that was
written into memory if the 12‐bit word read out is as follows:
Solution
(a)The 12‐bit Hamming code word containing 8 bits of data and 4 parity bits given
is,
(b) 000011101010
(c) 101110000110
(d) 101111110100
• When the 12 bits are read from memory, they are checked again for errors. The
parity is checked over the same combination of bits, including the parity bit.
•The original 8-bit data word can be retrieved after the 4 check bits are evaluated as
follows:
4. A 12‐bit Hamming code word containing 8 bits of data and 4 parity bits is
read from memory. What was the original 8‐bit data word that was written into
memory if the 12‐bit word read out is as follows:
(a) 000011101010
(b) 101110000110
(c) 101111110100
•In a) C = C8C4C2C1 = 0110, indicates that there is an error in the 6th bit of the
Hamming code. Therefore the correct 12-bit Hamming code is, 000010101010. Therefore
the original data word is, 0101 1010 (Except P1, P2, P4, and P8).
•In b) C = C8C4C2C1 = 0010, indicates error in bit 2. Therefore the correct 12-bit
Hamming code is, 111110000110. Therefore, the original data word is, 1100 0110.
•In c) C = C8C4C2C1 = 0000, indicates no error in the data word. Therefore, the
original data word is, 1111 0100 .
2. 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.
• If we include this additional parity bit, then the previous 12‐bit coded word becomes
001110010100P13, where P13 is evaluated from the exclusive‐OR of the other 12 bits.
• This produces the 13‐bit word 0011100101001 (even parity).
•When the 13‐bit word is read from memory, the check bits are evaluated, as is the parity P
over the entire 13 bits.
•If P = 0, the parity is correct (even parity), but if P = 1, then the parity over the 13 bits is
incorrect (odd parity).
The following four cases can arise:
• If C = 0 and P = 0, no error occurred.
• If C ≠ 0 and P = 1, a single error occurred that can be corrected.
• If C ≠ 0 and P = 0, a double error occurred that is detected, but that cannot be corrected.
• If C = 0 and P = 1, an error occurred in the P13 bit.
This scheme may detect more than two errors, but is not guaranteed to detect all such errors.
READ ONLY MEMORY (ROM)
ROM
In Read Only Memory (ROM) permanent binary image is stored, once the pattern is
established, it stays within the unit even when the power is turned off and on again.
Ex: 32 x 8 ROM
No. of words in ROM = 32(25)
Size of each word = 8 bits
No. of address lines needed = 5 bits
The output of the decoder represents the memory address.
The 32 outputs of the decoder are connected to each of the eight OR gates.
Each OR gate must be connected to 32 input.
ROM has 32 x 8 = 256 internal connections.
READ ONLY MEMORY (ROM)
COMBINATIONAL CIRCUIT IMPLEMENTATION
• By inserting OR gates to sum of minterms of Boolean functions, able to generate
any desired combinational circuit.
• The ROM is essentially a device that includes both the decoder and the OR gates
within a single device. By choosing connections for those minterms that are
included in the function, the ROM outputs can be programmed to represent the
Boolean functions.
• The internal operation of a ROM can be interpreted in two ways:
• i) It is a memory unit that contains a fixed pattern of stored words.
• ii) It is a unit that implements a combinational circuit.
F1 = (AB+AC+BC)’
F2 = AB+AC+A’B’C’
PROGRAMMABLE ARRAY LOGIC
(PAL)
PROGRAMMABLE ARRAY LOGIC (PAL)
• PAL is a programmable logic device with a fixed OR array and a programmable
AND array.
• Easier to program, but is not as flexible as the PLA
• Each input has a buffer-inverter gate and each output has a fixed OR gate.
• Each sections in the unit is composed of a three-wide AND-OR array.
• Unlike the PLA, a product term cannot be shared among two or more OR gates.
Therefore, each function can be simplified by itself without regard to common
product terms.
• The number of product terms in each section is fixed and if the number of terms
in the function is too large, it may be necessary to use two sections.
• If AND gate is not used, all its input fuses are left intact. Since the corresponding
input receives both the true and complement of each input variable, we have AA’
= 0, and the output of the AND gate is always 0.
• Sequential programmable devices include both gates and flip‐flops. In this way,
the device can be programmed to perform a variety of sequential‐circuit
functions.
• The internal logic of these devices is too complex. Therefore, a brief description
of three major types of Sequential Programmable devices is given.
• The SPLD includes flip‐flops, in addition to the AND–OR array, within the
integrated circuit chip.
Configuration of a SPLD
• The configuration mostly used in an SPLD is the combinational PAL together with
D flip‐flops.
• A PAL that includes flip‐flops is referred to as a registered PAL, to signify that the
device contains flip‐flops in addition to the AND–OR array.
Macrocell
• The output of the flip‐flop is fed back into one of the inputs of the programmable
AND gates to provide the present‐state condition for the sequential circuit.
• All the flip‐flops are connected to the common CLK input, and all three‐state
buffers are controlled by the OE input.
• Typical programming options include the ability to either use or bypass the
flip‐flop, the selection of clock edge polarity, the selection of preset and clear for
the register, and the selection of the true value or complement of an output. An
XOR gate is used to program a true/complement condition. Multiplexers select
between two or four distinct paths by programming the selection inputs.
• Each I/O pin is driven by a three‐ state buffer and can be programmed to act as
input or output.
• The switch matrix receives inputs from the I/O block and directs them to the
individual macrocells.
• Similarly, selected outputs from macrocells are sent to the outputs as needed.
Each PLD typically contains from 8 to 16 macrocells, usually fully connected.
• If a macrocell has unused product terms, they can be used by other nearby
macrocells. In some cases the macrocell flip‐flop is programmed to act as a D, JK,
or T flip‐flop.
47 SEQUENTIAL PROGRAMMABLE DEVICES
• The basic component used in VLSI design is the gate array, which consists of a
pattern of gates, fabricated in an area of silicon, that is repeated thousands of
times until the entire chip is covered with gates.
• Each Configurable Logic Block can generate logic functions of many inputs.
• The performance of each type of device depends on the circuit contained in its
logic blocks and the efficiency of its programmed interconnections.
• Logic blocks uses a lookup table, which is a truth table stored in an SRAM and
provides the combinational circuit functions for the logic block.
• These functions are realized from the lookup table, in the same way that
combinational circuit functions are implemented with ROM.
• For example, a 16 * 2 SRAM can store the truth table of a combinational circuit
that has four inputs and two outputs. The combinational logic section, along
with a number of programmable multiplexers, is used to configure the input
equations for the flip‐flop and the output of the logic block.
7. SEQUENTIAL PROGRAMMABLE DEVICES
• The advantage of using RAM instead of ROM to store the truth table is that the
table can be programmed by writing into memory.
• The disadvantage is that the memory is volatile and presents the need for the
lookup table’s content to be reloaded in the event that power is disrupted.
• SRAM based FPGA comes with EPROM which loads during power on.
Xilinx FPGAs
• Xilinx launched the world’s first commercial FPGA in 1985.
F = WY’ + XY’Z
G = WX’Y’ + X’ Y + W’Y’Z
Implement them with a ROM.
Implement them in the PLA using no more than four terms.
The dynamic physical interaction of the electrical signals affecting the data path of a
memory unit may cause occasional errors in storing and retrieving the binary information.
Therefore , the error detection schemes such as Parity Bit and Hamming Code is used to
detect and correct errors.
One of the most common error‐correcting codes used in RAMs was Hamming Codes. In the
Hamming code, k parity bits are added to an n ‐bit data word, forming a new word of n + k
bits.
4) What is PAL? How it differ from PROM and PLA? ( CO4, K1)
PAL is a programmable logic device with a fixed OR array and a programmable AND
array. Because only the AND gates are programmable, the PAL is easier to program than,
but is not flexible as, the PLA.
7) What are the terms that determine the size of a PAL? ( CO4, K1)
The size of a PLA is specified by the
Number of inputs, Number of products terms & Number of outputs
Part A Q & A (with K level and CO)
8) What is a Sequential Programmable Device? (CO5, k1)
• Sequential programmable devices include both gates and flip‐flops. In this way,
the device can be programmed to perform a variety of sequential‐circuit
functions.
• The SPLD includes flip‐flops, in addition to the AND–OR array, within the
integrated circuit chip.
1. A 12‐bit Hamming code word containing 8 bits of data and 4 parity bits is
read from memory. What was the original 8‐bit data word that was
written into memory if the 12‐bit word read out is as follows: (a)
000011101010 (b) 101110000110 (c) 101111110100 .
(CO6,K2)
2. It is necessary to formulate the Hamming code for four data bits, D3, D5,
D6, and D7, together with three parity bits, P1, P2, and P4. (a) *
Evaluate the 7‐bit composite code word for the data word 0010. (b)
Evaluate three check bits, C4, C2, and C1, assuming no error. (c)
Assume an error in bit D5 during writing into memory. Show how the
error in the bit is detected and corrected. .
(CO6,K2)
3. Given the 8‐bit data word 01011011, generate the 13‐bit composite
word for the Hamming code that corrects single errors and detects
double errors. (CO6,K2)
4. Obtain the 15‐bit Hamming code word for the 11‐bit data word
11001001010. (CO6,K2)
5. Implement the two following Boolean functions using 8 x 2 PROM. (
CO4, K6)
F1 =∑ m (3, 5, 6, 7) and
F2 =∑ m (1, 2, 3, 4)
6. Implement the following two Boolean functions using PLA with 3 inputs,
4 product terms and 2 outputs ( CO4, K6)
F1 =∑ m (3, 5, 6, 7) and
F2 =∑ m (1, 2, 3, 4)
A(x,y,z) =∑ m (1, 2, 4, 6)
B(x,y,z) =∑ m (0, 1, 6, 7)
C(x,y,z) =∑ m (2, 6)
F1 =∑ m (1, 3, 5) and
F2 =∑ m (5, 6, 7)
Implement the circuit with a PLA having 3 inputs, 3 product terms and two
outputs.
10. Explain the various Sequential Programmable Devices with neat
diagrams (CO5, K2)
Supportive online
Certification courses
(NPTEL, Swayam,
Coursera, Udemy, etc.,)
Supportive Online Certification
Courses
• Swayam:
• Digital Circuits By Prof. Santanu Chattopadhyay | IIT Kharagpur
• https://swayam.gov.in/nd1_noc19_ee51/preview
• Coursera:
• Digital Systems: From Logic Gates to Processors offered by Universitat
Autònoma de Barcelona
• https://www.coursera.org/learn/digital-systems
• Classcentral.com:
• Online Course - Digital Electronic Circuits by Indian Institute of
Technology, Kharagpur and NPTEL via Swayam
• https://www.classcentral.com/course/swayam-digital-electronic-circuits-
12953
• Udemy:
• Master The Digital Electronics- Minimisation And Basic Gates –
[Learn about the digital gates, boolean algebra, k-map| Update your digital
from base to pro]
• https://www.udemy.com/course/professional-digital-electronics/
Real time Applications
in day to day life and to
Industry
Real time Applications
ASIC full form is Application Specific Integrated Circuit. These circuits are
application specific .i.e. tailored made ICs for a particular application. These are
usually designed from root level based on the requirement of the particular
application. Some of the basic application-specific integrated circuit
examples are chips used in toys, the chip used for interfacing of memory and
microprocessor etc…These chips can be used only for that one application for which
these are designed. Presumably, these types of ICs are preferred only for those
products which have a large production run. As ASICs are designed from the root
level they have high cost and are recommended only for high volume productions.
The main advantage of ASIC is reduced chip size as a large number of functional
units of a circuit are constructed over a single chip. Modern ASIC generally includes
a 32-bit microprocessor, memory blocks, network circuits etc…Such type of ASICs is
known as System on Chip. With the development in manufacturing technology and
increased research in design methods, ASICs with different levels of customization
are developed.
Types of ASIC
Circuit Components
● LM358 – 1
● IR Transmitter or IR LED – 1
● Photo Diode – 1
● 10 KΩ – 1
● 150Ω – 1
● 10 KΩ POT – 1
● Buzzer – 1
The aim of this project is to implement a simple Burglar Alarm System that can
detect an unauthorized entry by a burglar. All the connections are made as per
circuit diagram. The working of the circuit is as follows.
LM358 is configured to work as comparator in this project. When the system is
powered on, the IR transmitter or IR LED emits infrared light. This light falls on the
surface of the photo diode.
As it is connected in reverse bias fashion, when the light falls on it, it conducts and
current flows through it. Since it is connected to the non-inverting terminal (pin 5)
of the op amp, output of the op amp comparator will be high. As the buzzer is
connected between Vcc and output of op amp, no alarm is made.
When an intruder or a burglar enters the gap between the IR transmitter and photo
diode, the light falling on the photo diode is interrupted and it doesn’t conduct.
As a result, the input at non-inverting terminal (pin 5) is less than the input at
inverting terminal (pin 6). Hence, the output of the comparator is low. This will
trigger the buzzer and a loud alarm is made.
Video Link
https://youtu.be/P3jz1oo-TXk
USB LED Lamp Circuit
LED Light bulbs are becoming more common and are replacing the CFL Bulbs. With
the cost of LED light bulbs becoming lower, people are gradually shifting towards
LED Lamps in their homes and offices. In this project, a simple USB LED Lamp
circuit is designed. This is an easy to implement DIY circuit that can be used to
provide an extra lighting for your laptop or tablet.
Components Required
● USB Male Connector
● Light Emitting Diodes – 5 X 5mm White LEDs
● Resistors – 100Ω X 5
● Perf Board
The cables will have same number of pins but they differ mechanically. Many
versions in USB were released. The first version USB 1.0 and 1.1 had the data rate
of 12 Mbps.USB 2.0 has data rate of 480 Mbps.USB 3.0 is expected to have data rate
of 4.8 Gbps.
USB used here is of type ‘A’. It has 4 pins. These pins are VCC, GND, D+, D-. The
D+ and D- pins are the data pins. VCC pin outputs the voltage of 5V. The USB LED
Lamp with Type ‘A’ male USB connector can be simply connected to the USB port of
the computer.
USB LED Lamp Circuit
LED is a semiconductor device with two leads. Generally LEDs were used for
indicating but now-a-days, LEDs are becoming the main sources of lighting in
homes, offices, streets, automobiles, etc.
An LED is similar to a normal P-N junction diode. The energy emitted is in the form
of light when applied with the required voltage, while normal P-N junction diode
emits energy in the form of heat.
The color of light emitted depends on the band gap of the semiconductor. The LEDs
used here are normal white LEDs. They have voltage drop of 3.6V. The current
required by the LEDs is 40mA.
Initially these LEDs are limited to the red color, later high power LEDs and other
colored LEDs such as blue LEDs, white LEDs etc. were developed.
A resistor of 100Ω is connected between the Light Emitting Diode and the USB.
This acts as a current limiting resistor. As the LEDs require maximum current of
40mA to glow with full brightness, they are required to protect from current more
than this.
So, for that reason, a resistor is to be placed between the LED and the power supply
to limit the amount of current flowing through the LED. The supply voltage coming
from the USB is 5V and the current drop at the Light Emitting Diode is 40 milli
amperes.
R=V/I
A Smoke Detector is a smoke sensing device that indicates fire. Smoke Detectors are
very common in homes, offices, schools and industries. Smoke Detectors are very
useful devices as the damage caused by fire accidents is catastrophic.Now a days,
smoke detectors and smoke alarms are very cheap as its usage is increasing and
cost of manufacturing is decreasing. In this project, a simple Smoke Detector Circuit
using simple hardware is implemented.
Components Required
● MQ-2 Sensor
● LM358
● 10KΩ
● 330Ω
● LED
● 0.1µF
● 10KΩ POT
Circuit Diagram:
Smoke Detector Alarm Circuit
Working:
Smoke Detectors are amazing devices as they are small, cheap yet very useful. In
this project, a simple Smoke Detector Circuit with adjustable sensitivity is
implemented.
A Smoke Sensor MQ-2 as the main sensory device. LM358 acts as a comparator in
this circuit. The inverting terminal of LM358 is connected to POT so that the
sensitivity of the circuit can be adjusted.
The output of LM358 is given to an LED as an indicator although a buzzer can be
used as an alarm. The non-inverting terminal of LM358 is connected with output of
smoke sensor.
Initially, when the air is clean, the conductivity between the electrodes is less, as the
resistance is in the order of 50KΩ. The inverting terminal input of comparator is
higher than the non-inverting terminal input. The indicator LED is OFF.
In the event of fire, when the sensor is filled with smoke, the resistance of the
sensor falls to 5KΩ and the conductivity between the electrodes increases.
This provides a higher input at the non-inverting terminal of comparator than the
inverting terminal and the output of comparator is high. The alarming LED is turned
ON as an indication of presence of smoke.
Note:
● The heating element in the Smoke Sensor must be preheated before it can
sense any smoke or gas.
● The sensor gets hot because of the heating coil and it is advised not to touch
the sensor while it is switched on.
● The sensitivity of the circuit to different concentrations of smoke can be
adjusted by using the POT.
● The output LED can be replaced with a loud buzzer for effective alarm.
Token systems are used to manage queues of people in banks, hospitals and other
places. Visitors are allotted serial token numbers and have to wait till there number
is called. These no.’s can be updated by entering the complete no. or by pressing
the up/down key in case it's a serially organized count. Here a very simple token
system or an up down counter is designed.
Components required :
● 1 x Arduino Uno R3 Board
● 1 x 4 Digit Multiplexed Seven Segment Board
● 1 x 8 Push Button Board
● 1 x Mini Breadboard
Optional
● Power Source (Battery with Snapper/DC Adapter) : 9-12V DC
● Tools
● Jumper Wires
Circuit Diagram:
This system mainly works on a principle that “water conducts electricity”. The four
wires which are dipped into the tank will indicate the different water levels. Based
on the outputs of these wires, microcontroller displays water level on LCD as well as
controls the motor.
Initially when the tank is empty, LCD will display the message LOW and motor runs
automatically. When water level reaches to half level, now LCD displays HALF and
still motor runs.
When the tank is full, LCD displays FULL and motor automatically stops. Again, the
motor runs when water level in the tank becomes LOW.
Components Required for Water Level Controller using 8051
Microcontroller
Video Link:
https://www.youtube.com/watch?time_continue=112&v=tYwQTTG-
GDg&feature=emb_logo
Analog To Digital Converter
The circuit shown in figure takes the given analog signal as input (varying from 0-5v)
and produces a digital output corresponding to the input given. In this circuit ,we
used three comparators and a 4*2 priority encoder. There are four resistors of equal
value of 1kohm each. And the reference voltage is taken as 5volts.
1. According to voltage division rule, the reference voltage given is divided into
3Vr/4 ,2Vr/4, Vr/4 at posituve terminal of the comparators respectively. Here, 'Vr' is
the reference voltage. Span is defined as the difference between maximum and
minimum analog input voltages and here, it is 5v. step size is given by span/2^n
where n is number of bits in the binary output(here, n=2). Hence, stepsize is
5/4=1.25 (here).
2. Now, the negative terminals of the comparators are given the input
voltage as analog signal and by comaparing the positive and negative terminals, as
the analog input voltage exceeds the reference voltage at each comparator, the
comparator outputs will go to a high state. By considering first comparator, the
negative terminal has input voltage 'Va' and the positive terminal has input as '3Vr/4' .
if Va is greater than 3Vr/4, the output will be logic 1; else the output will be logic 0.
Similarly, the same procedure is repeated for the remaining comparators with their
respective reference voltages.
Analog To Digital Converter
3. The outputs of comparators are given as inputs to the priority encoder and the
corresponding binary outputs are generated. The priority encoder generates a
binary number based on the highest-order active input, ignoring all other active
inputs. The output of the first comparator will be higher priority input compared
to other bits.
Input Outut
0-1.25 00
1.25-2.5 01
2.5-3.75 10
3.75-5 11
CIRCUIT DIAGRAM
Thank you
Disclaimer:
This document is confidential and intended solely for the educational purpose of RMK Group of
Educational Institutions. If you have received this document through email in error, please notify the
system manager. This document contains proprietary information and is intended only to the
respective group / learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender immediately by e-mail if you
have received this document by mistake and delete this document from your system. If you are not
the intended recipient you are notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.