# Help with decoders and RAM [Digital Logic]

Tags:
1. Apr 11, 2015

### MarcL

First I really don't know where I should post this (I'm assuming this place is fine, maybe coursework?)

So I built a circuit that includes a 1k x 4 RAM ( so I'm assuming that stands for 4000 Kb but I wouldn't see why you'd need to write 1k x 4 RAM)

Furthermore, I'm having trouble understanding how my decoder works. I used a 4-to-10 decoder and that means that there are only a possible of 10 outputs. That makes sense to me as there are only 10 pins. However, my ram can contain much more information then that, so why wouldn't I be able to do ( with my decoder) 10 inputs of all 1 and one 0. And then the inverse.

Thanks for the help!

2. Apr 11, 2015

### phinds

No, it does not. 4Kb is 4 kilo BYTES. What you have specified is 1 kilo nibbles, not 4 kilo bytes. A nibble is 4 bits. In other words, 1k x 4 RAM mean 1 kilo x 4 bits.

Ten pins of output implies 2^10, or 1024, or 1K possible combinations, which is exactly what you need to address 1K of anything.

Please don't take this as rude, but I have to ask, given your apparently complete lack of understanding of these things, how is it that you are trying to work with this stuff without first understanding it? What is it that you are doing? Is this for a course or what?

3. Apr 12, 2015

### MarcL

first i apologize for the formatting Im on a cellphone. Im in software engineering and we have to take a hardware class and we didnt need any pre requisites for that class. as for the decoder, im aware of it being being kilobits. My question was directed towards the truth table. As in why would it only take 10 inputs max. Is it because how the chip is manifactured? Furthermore, if it is active low, wouldnt there be a way to invert the signal sp we can get 20 outputs?

4. Apr 12, 2015

### phinds

A decoder with 10 outputs is NOT "kilobits", it is kilo-what-ever-you-are-addressing and in your case that is kilo NIBBLES, as I said in the first place.

What truth table?

I have no idea what you have in mind here. What does manufacturing have to do with anything? I don't understand what you are asking.

Sure, you can invert each bit and get its complement, but so what? You will not have any more information than the original 10 bits. What would be the point?

5. Apr 12, 2015

### rootone

I'm not sure what your are trying to describe, but I think I got part of it.
Your circuit apparently includes 4 x 1k RAM chips, so it's total storage is 4k.
You have ten outputs, this is enough to indicate a value of 1k.

In order to read the full content of your RAM, you will have to output it in four chunks.
In other words whatever the output connects to has to be some kind of serial port, and whatever it connect to must have a similar serial input port which is designed to use the ssme 4-chunk protocol.

6. Apr 12, 2015

### phinds

Why would you use serial? For basic designs, it's normal to avoid the complication of designing a parallel/serial converter and/or serial/parallel converter and just stick with parallel.

[EDIT: ah, I get it. You are assuming, pretty reasonably, the use of dynamic RAM chips with serial protocol. I'm used to doing more basic designs but I think you're right in this case]

Also, your use of the term "1k" is not at all incorrect in this context but it is potentially confusing since these days everyone pretty much assumes "1k" means "1k BYTES" and that's not what he has, as I have continued to point out to him.

7. Apr 12, 2015

### rootone

Yes, I was assuming from the description that his RAM consists of 4 chips, each having a capacity of 1 kilobyte.

8. Apr 12, 2015

### MarcL

So I know my lab describes the chip as 4 bits size cell. Which is fine, it clearly states that. I mean I understand that a nibble is a 4 bit number. However, sorry if I got that wrong, my class never covered the units ( really basics I know...). We only used bits or bytes. Hence my reference to bits. My big question was that, how can I find the size of the chip? I know it is 2^n where n is the number of address lines. Are there any other way to know the amount of address in the ram from the fact that it is 1k x 4?

[QUOTE
What truth table? [/QUOTE]

The truth table of the decoder where it has 4 inputs and 10 outputs ( 4-to-10). As shown here:

As I tried to explain above, I was asking whether or not it was possible to determine the amount of addresses without the information such as the address lines ( in this case 10, which I found through a drawing of the chip).

The point I was asking is that if the decoder has a maximum of 10 inputs ( 0000 to 1001 as the table shows above) and those are active low, would it be possible to add an extra 10 inputs ( so from 1010 and on) just by inverting the signal?

And it was one chip. I was using the SCM21C14E-4. It wasn't 4 chips in series. :)

9. Apr 12, 2015

### phinds

I have not a clue what your BCD to 10-line decoder could possibly have to do with your RAM. That is, it's perfectly clear what it does but I can't see any possibly connection to addressing your RAM. I think this must be some entirely other part of your project. I think you have taken on something that is just too far over your head and you need to study some digital logic basics.

10. Apr 12, 2015

### MarcL

I'm trying to understand the concepts of it, it was not covered in my class but it is clearly stated that i have to use it. I have the circuit diagram and I needed to connect my decoder to my ram in order to make my lab work, that is to connect my decoder to a timing generator. However in this case we connected it to LEDs. My questions were separate when it came to the RAM and decoder. I clearly asked how can you find the number of address without knowing how many address lines the RAM has ( which I stated above). As for my decoder I asked, separately that is, 1) why is there a maximum of input from 0 - 10. I get it's a 4-to-10 but wouldn't it be possible to create more if we inverted it from active low to active high creating a new sequence? 2) How does it display on the LED? So if you get an output of 6 being active low, how would the LED know which light to light up to create the the number 6 (0110).

Anyway you can try to avoid answering my question, I have been taking this class since january. I've studied what was given to me. That doesn't mean that I can understand fully what I was reading. It is not like I'm trying to get spoon fed the answer. I am legitimately seeking for help / answers.

11. Apr 12, 2015

### phinds

Well,assuming that you have a binary to BCD converter to START with, to get BCD shown as the input to your decoder, then the output is exactly what you want to light up one of 10 LED's based on the orginal number. So, it goes binary -> BCD -> 1 of 10 LED lighting.

[strike]DOH ! I just checked and your "BDC decoder" is NOT a BCD decoder at all. There's no BCD involved anywhere. So you're just going binary -> 1 of 10 LED lighting.[/strike] OK, it IS a BCD. The reason for my misstatement is more than would be useful to go into here.

You tell how many address lines you need for memory but taking the base 2 log of the number of things being addressed and rounding up if it's not exact.

There are NOT a maximum of 10 inputs, there are 4 inputs. There are 10 outputs.

As I already said, sure you could get more but you would STILL only have 10 unique outputs.

You hook each of the 10 outputs to a LED and when one line goes low, that LED lights up (you connect all the other sides of the LEDS to a power source and possibly a current limiting resistor).

It would "know" because it would have current flowing through it.

OK, point taken. I'm not trying to give you a hard time but the amount of stuff that you have not been taught relative to what you need to know to take on this project seem intimidating. It's commendable that you are trying to figure it all out.

12. Apr 17, 2015

### meBigGuy

1K x 4 ram is 1024 locations, each with 4 bits.

The 1024 locations are addressed by a 10 bit binary address. (2^10 = 1024) . You connect 10 address bits to the ram, and the output (or written location) depends on the address value.

If you wanted to implement a 1kx4 ram from scratch, you would require a 10 bit to 1024 line decoder. Each decoder output would enable the read or write of one of the 1024 4 bit registers.

The other possibility is that you are to connect a 4 to 10 line decoder to the output of a 1kx4 memory (getting its address from an undisclosed secret process) and use the decoder outputs to light LEDs. You could then make a graphics wand by sequencing through a properly programmed 1kx4 ram (but I'm just guessing).