Implementing Logic Function with a ROM

3 replies · 7K views · last reply
CoolDude420
Messages
199
Reaction score
9

Homework Statement


Text problem: implement Boolean functions A(x,y,z) = Σ(0,4,6), B(x,y,z) = Π(0,1,5,7), C(x,y,z) = Π(1,3,4), D(x,y,z) = Σ(0,2,5,7) using an 8 x 4 ROM, then specify memory contents at each address.


Homework Equations

The Attempt at a Solution


Handwritten notes: sum-of-minterms and product-of-maxterms for functions A to D of x, y, z, then a 8x4 ROM diagram with a 3-to-8 decoder driving four OR gates labelled A, B, C, D, and a table of memory contents for addresses 000 to 111.


I'm a bit confused with this. I thought a ROM was just a non-volatile storage. I don't understand how this would work. The decoder can only select one of the 8 outputs depending on what it gets at its input. I still attempted it but I am quite sure it isn't correct. Any ideas on how this is meant to work?
 
The output "gates" of a ROM are all the same (eg all OR gates) so you have to convert functions B and C to the required form first.

CoolDude420 said:
I'm a bit confused with this. I thought a ROM was just a non-volatile storage. I don't understand how this would work.

It is just non-volatile storage. Think about what a truth table is. It tells you what the outputs are for a given combination of inputs. You can think of a ROM as doing exactly the same thing.

In this example the ROM contains output data for all possible combinations of input from 000 to 111 so it can generate outputs for all possible combinations of input signals. In that respect it's actually better than hard wired logic. If you need to make a change you just reprogram the ROM. No need to rewire or change any logic gates.

Disadvantages might include cost, speed, area of silicon.
 
CWatters said:
The output "gates" of a ROM are all the same (eg all OR gates) so you have to convert functions B and C to the required form first.
It is just non-volatile storage. Think about what a truth table is. It tells you what the outputs are for a given combination of inputs. You can think of a ROM as doing exactly the same thing.

In this example the ROM contains output data for all possible combinations of input from 000 to 111 so it can generate outputs for all possible combinations of input signals. In that respect it's actually better than hard wired logic. If you need to make a change you just reprogram the ROM. No need to rewire or change any logic gates.

Disadvantages might include cost, speed, area of silicon.
Handwritten list of four Boolean functions in terms of x, y, z: A = sum of minterms 0, 4, 6; B = product of maxterms 0, 1, 5, 7 equals sum of minterms 2, 3, 4, 6; C = product of maxterms 1, 3, 4 equals sum of minterms 0, 2, 5, 6, 7; D = sum of minterms 0, 2, 5, 7.


Ah. I see. Would this be correct for the conversion? I just took the complement of the product of maxterms expression. (Id have to replace the AND gates with ORs and change the Xs
 
Yes that's correct.

You need not actually draw a circuit with x's and OR gates. You just need to provide the contents of the ROM in the form of a table with the Address and Data fields. Here is an example (different functions to yours)...

Truth table of a ROM with Address columns X and Y and Data columns A and B; rows 00, 01, 10, 11 map to data A B of 01, 10, 00, 10. Left labels read A(x,y)=Σ(1,3) and B(x,y)=Σ(0).


Although it might be better to label the address inputs A1(X) and A0(Y) and similarly for the data bits D1(A) and D0(B)