CHAPTER 6 Motherboard and ROM BIOS. Chapter Overview Computer Cases Motherboards ROM BIOS.
CHAPTER 4Memory 1. ROM
Transcript of CHAPTER 4Memory 1. ROM
Bräunl 2021 1
CHAPTER 4 Memory
ROM: ”Read Only Memory”– Read only+ Keeps data when powered down
RAM: ”Random Access Memory”+ Read/Write access– Loses data when powered down
Addresses are used tolocate words in memory
Bräunl 2021 2
1. ROM
• Will keep its contents when power is off• Contents cannot be changed• Used for system boot• Types: ROM, PROM, EPROM, EEPROM/Flash
Bräunl 2021
ROM
ROMA D
dataaddress
CS� OE�
10 8
3
Address Chip SelectData Output Enable
Bräunl 2021 4
ROM• ROM Read Only Memory
• Mask (data) supplied by customer• Mass production• Can never be changed
• PROM Programmable ROM• programmable ROM• comes “empty” (E.g. all bits are 1)• can be programmed (“burned”) by supplying certain voltages to a specific pin• “Burning” of fuses (wires) within chip, setting individual bits to 0• Once a bit is flipped, it can never be changed
• EPROM Erasable Programmable ROM• Original state can be restored, ~ 20mins UV exposure
• EEPROM (Flash) Electronically Erasable Programmable ROM• Can be electrically programmed/erased many times (~ 10,000)• “In circuit programming” (e.g. for system parameters in computer system)• Alternative solution: static RAM + battery backup à runs out after some time
Bräunl 2021 5
ROM ImplementationExample: ROM with 8 bytes contents
a2a1a0
d7 d6 d5 d4 d3 d2 d1 d0
Desired ROM contents• mem[0] = $01• mem[1] = $02• mem[2] = $05• mem[3] = $F2• mem[4] = $96• mem[5] = $F0• mem[6] = $78• mem[7] = $3CHex values
Dec
oder
01234567
(Schematics only)
EMPTY ROMAddress(input)
Data(output)
D
Bräunl 2021 6
ROM ImplementationExample: ROM with 8 bytes contents
a2a1a0
Desired ROM contents• mem[0] = 0000 0001• mem[1] = 0000 0010• mem[2] = 0000 0101• mem[3] = 1111 0010• mem[4] = 1001 0110• mem[5] = 1111 0000• mem[6] = 0111 1000• mem[7] = 0011 1100Binary values
Dec
oder
01234567
(Schematics only)
EMPTY ROM
d7 d6 d5 d4 d3 d2 d1 d0
Address(input)
Data(output)
D
Bräunl 2021 7
ROM ImplementationExample: ROM with 8 bytes contents
a2a1a0
Dec
oder
01234567
(Schematics only)
d7 d6 d5 d4 d3 d2 d1 d0
Address(input)
Data(output)
Desired ROM contents• mem[0] = 0000 0001• mem[1] = 0000 0010• mem[2] = 0000 0101• mem[3] = 1111 0010• mem[4] = 1001 0110• mem[5] = 1111 0000• mem[6] = 0111 1000• mem[7] = 0011 1100Binary values
D
Bräunl 2021 8
ROM Implementation
a2a1a0
d7 d6 d5 d4 d3 d2 d1 d0Decoder
01234567
GND
5V
1kW
5V orGND
1kW
diode
Address(input)
Data(output)
D
Bräunl 2021 9
2. RAM• Will lose its contents when power is off• Contents can be changed any time• Can store programs or data• Writing data to a location (“address”) overwrites
old data contents• Types: Static, Dynamic
Static RAM– Static RAM keeps data as long as power is on
Dynamic RAM– Dynamic RAM “leaks” memory contents over short time period,
needs periodic “refresh” à periodical read/write all cells
Bräunl 2021
RAM
RAMCS� R/W� OE�
A Ddataaddress
10 8
10
Address Chip SelectData Read / Write
Output Enable
Easy to build – will show laterLike FF with D and Q on same pin,but R/W’ to distinguish between
Bräunl 2021 11
RAM ImplementationSimilar to ROM, but replace connection element • by active switch
1. DRAM (dynamic RAM, needs �refresh� ~ 500 times/sec, 1 FETransistor)
C RGND
data line Capacitor: no change (empty) = 0 charged = 1
address line
12
RAM Implementation2. SRAM (static RAM, no �refresh� required, 6 FETransistors)
CMOS = complementary metal oxide silicon
address
data' data
data + data� required, since n-channel pass transistors conduct only zeroes well
Bräunl 2021 Diagram: IBM
Bräunl 2021 13
3. Memory Size – 1 bit
MemData
Here ROM shown, but same for RAMMem = 1 cell = 1 bit (=1 flip-flop)
Single bit
Smallest m
emory possi
ble
Bräunl 2021 14
Memory Size – 1 Byte (= 8 bits)
Mem = 8 bits
MemData
MemData
MemData
MemData
MemData
MemData
MemData
MemData
Bräunl 2021 15
Memory Size – 1 Byte (= 8 bits)
Mem .
8 Data Lines = Data Bus
Mem = 8 bits Bräunl 2021 16
Memory Size – 1 Byte (= 8 bits)
Mem8
Data Bus
Mem = 8 bits
Bräunl 2021 17
Memory Size – 2 Bytes
Mem
Data Bus
Mem = 2*8 = 16 bits
Mem
enable
enable
• 2 Outputs coming together on the same line!• Only one device is allowed to send data at a timeØ Enable/disable mechanism via tri-state gates required
Bräunl 2021 18
Memory Size – 2 Bytes
Mem
8 Data Bus
Mem = 2*8 = 16 bits
Mem
enable
enable 8
8
• 2 Outputs coming together on the same line!• Only one device is allowed to send data at a timeØ Enable/disable mechanism tri-state gates required
Bräunl 2021 19
Memory Size – 2 Bytes
Mem
Mem = 2*8 = 16 bits
Enable (Address)
Mem
8 Data Bus8
8
Bräunl 2021 20
Memory Size – 2 Bytes
Mem
Mem = 2*8 = 16 bits
Enable (Address)0
Mem
Enable=0
Enable=1
8 Data Businactive
0
1
Bräunl 2021 21
Memory Size – 2 Bytes
Mem
Mem = 2*8 = 16 bits
Enable (Address)1
Mem
8 Data Bus8
8Enable=0
Enable=1
inactive
1
0
Bräunl 2021 22
Memory Size – 2 Bytes
8
Data Bus
Mem = 2*8 = 16 bits
1 Address Line
Mem
Bräunl 2021 23
Memory Size – 4 Bytes
8
Data Bus
Mem = 4*8 = bits
2 Address Lines
Mem
Bräunl 2021 24
Memory Size – 8 Bytes
8
Data Bus
Mem = 8*8 = 64 bits
3 Address Lines
Mem
Bräunl 2021 25
Memory Size – 2n Bytes
n
Address Bus
Mem8
Data Bus
Mem = 2n * 8 bits
• 1 addr. line ® 2 data cells• 2 addr. lines ® 4 data cells• 3 addr. lines ® 8 data cells
…• n addr. lines ® 2n data cells
Bräunl 2021 26
• Control lines– Chip-SELECT’ activate memory chip– Output-Enable’ write data to bus (req. for multiple modules)
– Read/Write’ activate writing (RAM only)
Mem2n * m bits
Address
n
Data
m
CS’ R/W’ OE’
4. Memory Control
Bräunl 2021 27
01
Mem2n * m bits
Address
n
Data
m
CS’ R/W’ OE’(don’t care)
Mem2n * m bits
Address
n
Data
m
CS’ R/W’ OE’
Mem2n * m bits
Address
n
Read Data
m
CS’ R/W’ OE’
Mem2n * m bits
Address
n
Write Data
m
CS’ R/W’ OE’(don’t care)
Memory Control
Bräunl 2021 28Source: MIT 6.111 Notes
Chip enable
Output enable
Chip enable
READ CYCLE
WRITE CYCLE
copy data to memory
Bräunl 2021 29
Mem2n * m bits
CS’ R/W’ OE’
Address
n
Data
m
Memory and CPU
CPUm data lines
n address lines
Data
m
Bräunl 2021 30
5. Addresses• Smallest information unit is one bit,
can be “0” or “1”.• Eight bits are called one Byte.
•
most significant bit … least significant bit
• Memory cell width is called a word,e.g. 8, 16, 32 bits
0 1 0 1 1 1 0 17 6 5 4 3 2 1 0MSB LSB
Bräunl 2021 31
Address Space• Memory Size: kilobyte (KB = 210 Bytes = 1’024 Bytes),
megabyte (MB = 210 KB = 220 Bytes),gigabyte (GB = 210 MB = 230 Bytes)terabyte (TB = 210 GB = 240 Bytes)
• Note the difference: k=1’000, K=1’024 (same for M, G, T)!• Size of a memory module is calculated as:
size = number of cells * cell size[remember: area = height * width]
• Example: A Memory module has 2M cells with 16bits per cell.What is its size in MB?2M * 2 Bytes = 4MB
Bräunl 2021 32
• The number of cells in a memory moduledetermines the number of address lines required.
• Memory module sizes are always powers of 2– 1 cell à no address line required– 2 cells à 1 address line– 4 cells à 2 address lines– …– 1024 = 1K cells à 10 address lines– 1M cells à 20 address lines– 1G cells à 30 address lines– 2n cells à n address lines
Mem2n cells
Address
n
Address Space
Bräunl 2021 33
• The number of bits in a memory celldetermines the number of data lines required.
• One data line is required per bit• Typical memory cell sizes are 4, 8, 16, 32, 64
Mem2n * m bits
Address
n
Data
m
Address Space
Bräunl 2021 34
Address SpaceExample:• 8 cells, 2 Bytes per cell
Total 16 Bytes• 3 address lines• 16 data lines
Question:• How many address lines has a
4M * 1Byte memory module?• How many data lines has this
module?
4M = 22*220 = 222 à 22
1Byte = 8 bits
Address$0$1$2$3$4$5$6$7
Bräunl 2021 35
Address Space
Example: Standard 8 bit controller
• 16 address bits
Example: Motorola 68.332
• 27 address bits, 16 data bits
® max. 64KB memory size
® max. 128M * 2B words = 256MB memory size
Bräunl 2021 36
QUIZ – Address, Memory
Bräunl 2021 37 Bräunl 2021 38
How many address lines does a4MB RAM have (word size: byte) ?
A. 8
B. 14
C. 22
D. depends
http://robotics.ee.uwa.edu.au/quiz/
Bräunl 2021 39 Bräunl 2021 40
Bräunl 2021 41
How many data lines does a4MB RAM have (word size: byte) ?
A. 8
B. 9
C. 16
D. depends
http://robotics.ee.uwa.edu.au/quiz/ Bräunl 2021 42
Bräunl 2021 43 Bräunl 2021 44
How many cross points (bits) does a256KB ROM have ?
A. 256,000
B. 262,144
C. 2,048,000
D. 2,097,152
http://robotics.ee.uwa.edu.au/quiz/