Lecture 30 Read Only Memory ROM 1 Overview

  • Slides: 25
Download presentation
Lecture 30 Read Only Memory (ROM) 1

Lecture 30 Read Only Memory (ROM) 1

Overview ° Read-only memory can normally only be read ° Internal organization similar to

Overview ° Read-only memory can normally only be read ° Internal organization similar to SRAM ° ROMs are effective at implementing truth tables • Any logic function can be implemented using ROMs ° Multiple single-bit functions embedded in a single ROM ° Also used in computer systems for initialization • ROM doesn’t lose storage value when power is removed ° Very useful for implementing FSMs 2

Read-Only Memory (ROM) ° An array of semiconductor devices • diodes • transistors •

Read-Only Memory (ROM) ° An array of semiconductor devices • diodes • transistors • field effect transistors ° 2 N words by M bits ° Data can be read but not changed • (normal operating conditions) Data is written to the ROM once, and read from the ROM many times. A read-only memory (ROM) consists of an array of semiconductor devices that are interconnected to store a set of binary data. Once binary data is stored in the ROM, it can be read out whenever desired, but the data that is stored cannot be changed under normal operating conditions. 3

ROM ° ROMs are actually combinational devices, not sequential ones! • You can’t store

ROM ° ROMs are actually combinational devices, not sequential ones! • You can’t store arbitrary data into a ROM, so the same address will always contain the same data. • You can think of a ROM as a combinational circuit that takes an address as input, and produces some data as the output. ° A ROM table is basically just a truth table. • The table shows what data is stored at each ROM address. • You can generate that data combinationally, using the address as the input. 4

Read-Only Memory (ROM) ° N input bits ° 2 N words by M bits

Read-Only Memory (ROM) ° N input bits ° 2 N words by M bits ° Implement M arbitrary functions of N variables • Example 8 words by 5 bits: 3 Input Lines A B C ROM 8 words x 5 bits F 0 F 1 F 2 F 3 F 4 5 Output Lines 5

ROM – Basic Structure address data 6 6

ROM – Basic Structure address data 6 6

ROM Implementation ° ROM = "Read Only Memory" • values of memory locations are

ROM Implementation ° ROM = "Read Only Memory" • values of memory locations are fixed ahead of time ° A ROM can be used to implement a truth table • • if the address is m-bits, we can address 2 m entries in the ROM. our outputs are the bits of data that the address points to. m • n 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 1 0 0 0 0 1 m is the "height", and n is the "width" 7

ROM Implementation ° Suppose there are 10 inputs 10 address lines (i. e. ,

ROM Implementation ° Suppose there are 10 inputs 10 address lines (i. e. , 210 = 1024 different addresses) ° Suppose there are 20 outputs ° ROM is 210 x 20 = 20 K bits size) (and a rather unusual ° Rather wasteful, since lots of storage bits • For functions, doesn’t take advantage of K-maps, other minimization 8

Read-Only Memory (ROM) Each minterm of each function can be specified 3 Inputs Lines

Read-Only Memory (ROM) Each minterm of each function can be specified 3 Inputs Lines A B C ROM 8 words x 5 bits F 0 F 1 F 2 F 3 F 4 5 Outputs Lines 9

ROM Internal Structure n Inputs Lines. . . n bit decoder . . .

ROM Internal Structure n Inputs Lines. . . n bit decoder . . . Memory Array 2 n words x m bits . . . m Outputs Lines 10

ROM Memory Array m 0=A’B’C’ m 1=A’B’C A B C m 2=A’BC’ 3 to

ROM Memory Array m 0=A’B’C’ m 1=A’B’C A B C m 2=A’BC’ 3 to 8 decoder m 3=A’BC m 4=AB’C’ m 5=AB’C m 6=ABC’ m 7=ABC F 0 F 1 F 2 F 3 F 4 11

Inside the ROM ° Alternate view • Each possible horizontal/vertical intersection indicates a possible

Inside the ROM ° Alternate view • Each possible horizontal/vertical intersection indicates a possible connection ° Or gates at bottom output the word selected by the decoder (32 x 8) 12

ROM Example Specify a truth table for a ROM which implements: F = AB

ROM Example Specify a truth table for a ROM which implements: F = AB + A’BC’ G = A’B’C + C’ H = AB’C’ + ABC’ + A’B’C 13

ROM Example Specify a truth table for a ROM which implements: F = AB

ROM Example Specify a truth table for a ROM which implements: F = AB + A’BC’ G = A’B’C + C’ H = AB’C’ + ABC’ + A’B’C 14

ROM Example Specify a truth table for a ROM which implements: F = AB

ROM Example Specify a truth table for a ROM which implements: F = AB + A’BC’ G = A’B’C + C’ H = AB’C’ + ABC’ + A’B’C 15

Function Implementation m 0=A’B’C’ m 1=A’B’C A B m 2=A’BC’ 3 to 8 decoder

Function Implementation m 0=A’B’C’ m 1=A’B’C A B m 2=A’BC’ 3 to 8 decoder C m 3=A’BC m 4=AB’C’ m 5=AB’C m 6=ABC’ m 7=ABC Each column is a new function Note: two outputs unused! F G H 16

17

17

Decoders ° We can already convert truth tables to circuits easily, with decoders. °

Decoders ° We can already convert truth tables to circuits easily, with decoders. ° For example, you can think of this old circuit as a memory that “stores” the sum and carry outputs from the truth table on the right. 18

ROM setup ° ROMs are based on this decoder implementation of functions. • A

ROM setup ° ROMs are based on this decoder implementation of functions. • A blank ROM just provides a decoder and several OR gates. • The connections between the decoder and the OR gates are “programmable, ” so different functions can be implemented. ° To program a ROM, you just make the desired connections between the decoder outputs and the OR gate inputs. 19

ROM example ° Here are three functions, V 2 V 1 V 0, implemented

ROM example ° Here are three functions, V 2 V 1 V 0, implemented with an 8 x 3 ROM. ° Blue crosses (X) indicate connections between decoder outputs and OR gates. Otherwise there is no connection. A 2 A 1 A 0 V 2 = m(1, 2, 3, 4) V 1 = m(2, 6, 7) V 0 = m(4, 6, 7) 20

Same Example ° Here is an alternative presentation of the same 8 x 3

Same Example ° Here is an alternative presentation of the same 8 x 3 ROM, using “abbreviated” OR gates to make the diagram neater. ° This combinational circuit can be considered a read-only memory. • It stores eight words of data, each consisting of three bits. • The decoder inputs form an address, which refers to one of the eight available words. • So every input combination corresponds to an address, which is “read” to produce a 3 -bit data output. V 2 = m(1, 2, 3, 4) V 1 = m(2, 6, 7) V 0 = m(4, 6, 7) A 2 A 1 A 0 V 2 V 1 V 0 21

ROMs vs. RAMs ° There are some important differences between ROM and RAM. •

ROMs vs. RAMs ° There are some important differences between ROM and RAM. • ROMs are “non-volatile”—data is preserved even without power. On the other hand, RAM contents disappear once power is lost. • ROMs require special (and slower) techniques for writing, so they’re considered to be “read-only” devices. ° Some newer types of ROMs do allow for easier writing, although the speeds still don’t compare with regular RAMs. • MP 3 players, digital cameras and other toys use Compact. Flash, Secure Digital, or Memory. Stick cards for non-volatile storage. • Many devices allow you to upgrade programs stored in “flash ROM. ” 22

ROM Implementation of a Moore Machine ° ROMs implement combinational logic ° Note that

ROM Implementation of a Moore Machine ° ROMs implement combinational logic ° Note that ROMs do not hold state ° How would you determine the maximum clock frequency of this circuit? • Look at the FF to FF path (NS to PS) Inputs ROM Present State Next State ROM Outputs 23

ROM Implementation of a Mealy Machine ° ROMs implement combinational logic ° Note that

ROM Implementation of a Mealy Machine ° ROMs implement combinational logic ° Note that ROMs do not hold state ° How would you determine the maximum clock frequency of this circuit? • Look at the FF to FF path (NS to PS) Inputs ROM Present State Next State ROM Outputs 24

Summary ° ROMs provide stable storage for data ° ROMs have address inputs and

Summary ° ROMs provide stable storage for data ° ROMs have address inputs and data outputs • ROMs directly implement truth tables ° ROMs can be used effectively in Mealy and Moore machines to implement combinational logic ° In normal use ROMs are read-only • They are only read, not written ° ROMs are often used by computers to store critical information • Unlike SRAM, they maintain their storage after the power is turned off 25