Lecture #2
Lecture #2
Lecture #2
Dept. of Computer & Systems Engineering
Credits to Dr. Hazem Shehata and Dr. Ahmed Abdul-Monem Ahmed for the slides
Chip Logic
• Semiconductor memory comes in packaged chips.
• Each mem. chip contains an array of memory cells.
• Design issue: number of bits of data that maybe
read/written at a time.
—One extreme: 1-word-per-chip organization: physical
arrangement of cells in the array is the same as logical
arrangement of words in memory.
– EX.: 1Mx16 memory = One 1Mx16 chip.
—Other extreme: 1-bit-per-chip organization: data is
read/written 1 bit at a time.
– Ex.: 1Mx16 memory = sixteen 1Mx1 chips s.t. chip #1 holds bit
#1 of each word, chip #2 holds bit #2 of each word, and so on.
Typical 16 Mb
DRAM (4Mx4)
Typical 16 Mb DRAM (4M x 4)
•11 address signals are passed to define the row
address, accompanied by asserting RAS’ (row address
select)
• Then, 11 other address signals are passed to define
the column address, accompanied by asserting CAS’
(Column address select)
Typical 16 Mb DRAM (4M x 4)
• If WE’ (write enable) is asserted:
-Bit driver of each bit line is activated; (4 lines, one for
each bit) -Voltage signal is applied to bit line
-A signal is applied to address line, allowing capacitor
to charge
• If OE’ (output enable)is asserted: -Address line is
selected, transistor turns on -Charge stored in
capacitor is fed out onto a bit line to a sense
amplifier -Sense amplifier compares capacitor
voltage to a reference value & determines if cell
contains a logic 0 or 1 -Value is presented to data
line; (4 lines, one for each bit)
Typical 16 Mb DRAM (4M x 4)
• To select a specific bit: — Select an address,
then assert RAS’ (row address select — Then,
select another address, then assert CAS’ (column
address select)
• Then assert WE’, or OE’ (write enable and
output enable)
• Reduces number of address pins — Multiplex
row address and column address — 11 pins to
address (211=2048) — Adding one more pin
doubles range of values.
Refreshing
Why does DRAM cell need refreshment?
• A DRAM cell consists of a capacitor to store one
bit of data as electrical charge.
• The capacitor leaks charge over time, causing
stored data to change.
• As a result, DRAM requires an operation called
refresh that periodically restores electrical
charge in DRAM cells to maintain data integrity
Refreshing
• Refresh circuit included on chip.
• Disable chip.
• Count through rows.
• Data is read out and written back into the same
location ➔ each cell is refreshed.
• Takes time.
• Slows down apparent performance.
Refreshing
A memory cell is automatically refreshed by:
• Accessing its row
• Reading from it
• Writing into it
256k x 8 memory
Module
Organization
• In this memory module of 256k 8-bit words, 18
bit address is needed & is supplied to the
module from some external source.
• The address is presented to 8 256Kx1 bit chips
each provides I/O of 1 bit.
• When larger memory is required, an array of
chips is needed.
Module Organization (2)
• Available: 256k x 1-bit chips
1M x 8 memory
Error Correction
• Semiconductor memory is subject to errors
— Rate: 1 error/hour to 1 error/century in a 1GB memory!
— Types: hard and soft.
• Hard Failure
— Permanent physical defect.
— Mem. cells can’t store data: stuck at 0 or 1, or switching.
— Caused by harsh environments, manufacturing defects, or wear.
• Soft Error
— Random, non-destructive event that alters contents of one or
more memory cells.
— No permanent damage to memory.
— Caused by power supply problems or alpha particles.
• Detected/corrected using Hamming error correcting code.
Error-Correcting Code Function
Error-Correcting Code Function
• When data are to be read into memory, a calculation
is performed on the data to produce a code of length
k.
• Code and data are stored. If an m bit word is to be
stored, then the size of stored word is M + K bits
• Code is used to detect and possibly correct errors. A
new set of k code is generated form k data bits and
compared with fetched code bits. This yields to:
▪ No errors are detected. The fetched data bits are sent out
▪ An error is detected, and possible to correct it. The data bit plus error correction
bits are fed into the corrector, which produce a set of M bits to be sent out.
▪ An error is detected, but it is not possible to correct it. This condition is reported
Hamming Error-Correcting Code
Data bits: 1110
B
A
1 1 0
1
0
1 0
Discrepancies
0
Parity bits
C
Chosen so that total number of 1s in each circle is even.
By checking the parity bits, discrepancies are found ➔ error
can be easily found and corrected.
Error-Correcting Codes
• A codeword consists of N bits split into M data
bits and K check (redundant) bits
— N = M + K.
• Hamming distance: Number of bit-positions in
which two codewords differ.
— Ex.: 11001001, 10100001 → Hamming distance = 3 →
3 bit errors are needed to convert one into the other.
• Note: in a code, not all 2N codewords are legal.
• Hamming distance of the whole code: minimum
Hamming distance between 2 legal codewords.
• A distance d code can:
— Detect: d – 1 errors.
— Correct: (d – 1)/2 errors if d is odd, or (d/2) – 1 errors if
d is even.
Error Detection/Correction
• Detection: parity bit.
• Distance = 2 → can detect up to 1 bit error.
• Ex.: data=1011010 → codeword=10110100 → any
codeword with a distance = 1 (such as: 10100100)
is considered illegal → single-bit errors are
detectable.
• Correction: Consider a code with 4 valid
codewords:
0000000000, 0000011111, 1111100000, 1111111111
• Distance = 5 → can correct up to 2 bit errors.
• If 0000000111 arrives, → 0000011111
• If 0000000000 becomes 0000000111 due to 3
errors → cannot be corrected properly.
Single Bit Error Correction
2K - 1 ≥ M + K ➔ 2K ≥ 9+K ➔ K = 4
1 0 0 1 1 0 1 0 Data bits
12 11 10 9 8 7 6 5 4 3 2 1
0 1 0 1 ?
1 0 0 1 ? 1 0 1
? 1
?
0 1
0 1 1
0 0 =?
Bit position 8
1
2
4 Bit position 8:
1: 0
2:
4: 1
Hamming Code
Hamming Code (2)
12 11 10 9 8 7 6 5 4 3 2 1
1 0 0 0
1 ?
0 1 0 1 ?
1 0 1
? 1
?
Wrong!!!
A B
1
0 0 1
0
1
1 1
0 Fix error
0 Discrepancies
C
Hamming SEC-DED Code (2)
A B
1
0 0 1
0
1
1 1
0 Fix error
0 Discrepancies
×1 C
Hamming SEC-DED Code (3)
Increase in Word Length with Error Correction
PROJECT : TASK 2
Find an idea: