Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Mod 8 Counter written to Ram Help Please!

Status
Not open for further replies.

ae4jm

New Member
I want to make an up counter that counts to seven using jk flip flops. Then, I want to take the seven and put it into a ram, must be the 7489 ram, and be able to read the decimal 7 on LED's as 111 off of the ram. This would prove that I have an up counter that counts to 7 and inputs that into the 7489 in which I stored to memore and then the led's proving that I'm able to read that memory. Here's a mod 8 counter circuit that uses jk flip flops, but when it gets to 7, displayed on the led's, 8 never appears but resets to 000. I was wondering if you guys could help me out.[/img]
 

Attachments

  • scan0001_114.jpg
    scan0001_114.jpg
    151.9 KB · Views: 811
That's because 8 requires four bits. You need one more flip-flop to display an 8. If you can make any combination of 4, 2, and 1 add up to 8 you'll certainly win some kind of prize.

If you want the count to stop at seven then you need to decode that state and adjust the JK inputs to the hold condition. If you add another stage and want to stop at 8 then the output of the forth stage will do that for you.
 
Mod 8 Counter to RAM

Thanks for reply,

But I was wondering if there might be a circuit or if you could help me with the hookup of the ram to a circuit similiar to this. This is the up counter that I need, I need to take the 7 off of this led when the counter counts up to 7 and save that binary 0111 to memory in a RAM, I need to use the 7489 IC for this. I would also like to have my counter stop at 7 and input it into the ram at this time, without any switches, just gates etc. Then I can read from my memory, I'll be using LED's again, and when I read my memory I'll get the 0111 proving that I stored the 0111 in RAM. Did I make any sense or did I just confuse everyone and myself? LOL! Thanks, any help is greatly appreciated!

AE4JM
 
For the life of me I can't figure out why you would want to use such an obsolete chip, and a power hog to boot. Why not just connect the outputs of the counter to what ever is reading the memory. You know that the memory outputs are driven all the time. The outputs do not go to a high impeadance state when the memory is not being addressed.

In any case since you appear to need only one location you might as well pull all four address inputs up through a single 1K resistor. So you will be using address 15 in the RAM. Connect the data outputs of the JK flip-flops to the data inputs D1, D2, and D3, and ground input D4.

The truth table for ME* and WE* tells us that both must go low to write a value. By the way how do you know what value will be in the memory when you turn the power on?

To read the value from the memory you must have ME* low and WE* high. You know that you will read the complement of what you wrote into the memory -- right?

I guess that means we can ground ME*

To decode the counter, use a three input NAND gate to generate a low when the counter is equal to 7. Now combine the output with the clock using a two input OR gate. The negative logic function is a low and a low is a low. This will be WE*. I'm guessing that you can use the output of the three input NAND gate to stop the counter.

What will reset the counter? Just curious.
 
Mod 8 Counter

Thanks for the info,

This is for a final project in electronics class. I'm trying to get some info on how I could go about making this setup work. That's the only RAM IC I know of that we have. That was what we had to come up with, a counter that couted to 7 and then stored the 7 in RAM, then show that it was in RAM by displaying it on LED's in binary. I don't even believe that this would be a real world situation, but I guess it's possible?

Thanks for your help!

I almost forgot about your last question, I'm not worrying about resetting the counter after I've got my 7 and have it stored in RAM, and of course demonstrating that I have it stored in RAM by the LED's. I can reset the counter by cutting the power off, no big deal. It's just that the counting and writing to memory must be automatic and not me flipping switches or buttons or what not. I've already got my counter built, I used a 555 timer IC, I'm just slipping a little bit on how to get the counter to stop at 7 and write to memory then display the memory on the LED's. That's where I'm caught scratching my nogging, LOL!

Thanks
 
The reason JK flip-flops exist is to have four(4) different things they can do when the clock edge arrives. These four things are

1. Set Q output to 1
2. Set Q output to 0
3. Set the Q output to Q, that is hold the presnet state.
4. Set the Q output to Q*, that is toggle or complement the present state.

If you look at the the way counters operate, and you connect Q to J and Q* to K you realize why JK flip-flops are convenient for implementing counters. To stop a counter you must get J and K into the "hold the present state". When power comes on they must be in the Set Q output to zero state. When the RESET condition is released they must count from zero to 7 by being in the toggle state.

I don't know if this helps but you gotta do some of this on your own.
 
Mod 8 Counter

Thanks,

Yes I understand that I must do some of this on my own, I know that I need the experience. I believe that I'm on the same page as you. I don't really have to have a mod 8 counter I don't think, just as long as when I get the 0111 led's lit after the jk flip flops, I must have the gates setup to write this to ram, I think that I just need to count to 7, or 111, one time and have the counter stop, because one time will be enough to put the 0111 into ram, then I'll be able to turn the read ram on and view my 0111 on my led's coming from my RAM. Does this sound correct? Again, I really appreciate the help and info.
 
Yes
 
Mod 8 Counter to RAM

Papabravo said:
In any case since you appear to need only one location you might as well pull all four address inputs up through a single 1K resistor. So you will be using address 15 in the RAM. Connect the data outputs of the JK flip-flops to the data inputs D1, D2, and D3, and ground input D4. Can't I just wire A0, A1, A2 and A3 straight to +5 volts instead of using the pull up resistors?

The truth table for ME* and WE* tells us that both must go low to write a value. So I'll ground ME* and use the three input nand gate coming off of my three jk flip flop outputs to put a low to WE* when my counter reaches 0111?

To decode the counter, use a three input NAND gate to generate a low when the counter is equal to 7. Can I not use this same low when the counter is equal to 7 to send a low to my WE*? The OR Gate is for what? I'm getting stumped here, what do you mean combine the clock with the low from the nand gate, where do I need the high from the OR? Now combine the output with the clock using a two input OR gate. The negative logic function is a low and a low is a low. This will be WE*. I'm guessing that you can use the output of the three input NAND gate to stop the counter.
What will reset the counter? Just curious. Again, I really appreciate all of your expertise, it's great to be able to ask some of these questions outside of the lab and to be able to learn outside the class room![color=blue][/color]
 
Yes the inputs can go to +5Volts. Using pullups is an automated test thing.

Your counter only has three bits and so it can't reach 0111, it can only reach 111. The extra zero in the RAM comes from grounding the D4 input to the RAM.

Combining the output of the three input NAND gat with the clock produces a WE* pulse when the clock is low. Presumeably the counter reached 111 on the rising edge of the clock, and the first WE* pulse will occur on the falling edge of the clock, or 1/2 cycle later.
 
Mod 8 Counter

Papabravo,

Thanks for your help. I got the circuit functioning as needed. I didn't use the OR gate because with my positive pulse clock I was always getting a high to my write enable. Instead of tying the data inputs of the RAM to high, I came off of my 4 LED's, I used a 74192 instead of the JK flip flops, less hookup and fewer components. Then, to clear the RAM and rewrite the RAM, per instructor, I sent a low single shot clock pulse to write enable when the LED's were at low, in turn writing a 0000 to my RAM and clearing the memory, then I sat back and let the 0111 come up again and write this to memore and demonstrate that the 0111 was stored in memory.

Thanks very much for all your help,

Matt
 
Glad it worked for you.
 
project

i have 2 make a project which with a controlled signal becomes mod 2 mod 4 nd mod 8 counter nd then want 2 display the count on a 7 segment led display...pls help
 
i have 2 make a project which with a controlled signal becomes mod 2 mod 4 nd mod 8 counter nd then want 2 display the count on a 7 segment led display...pls help

hi,:)
Please start your own new thread, this thread is 3 years old.!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top