Monday, September 5, 2011

Bubble Pushing Shift Register

This will be just and quick post, and IT HAS PICTURES!!!  I am working on a bi-directional shift register for tracking and moving the car and I thought I would share a simple technique for reducing gate counts or in my case keeping everything NAND.  It is called bubble pushing.  Check out this PDF from Oklahoma State University on the subject, pages 14-18.

This is a key component of the bi-directional shift register. It can be simplified by bubble pushing.

Both the top and bottom block function as an OR gate.


Replace the OR gate with the three NAND gates.


The Double NOR (NAND) gates cancel giving the final result.  This also converts it to an all NAND gate configuration as well as reducing the gate count by 2 per output.


Sunday, September 4, 2011

Custom Display

Let me first start out by announcing the game.  It is the scrolling race car game, the car is at the bottom of the screen and the track comes down at you and shifts left and right, you know the one.  My fist thought was to make something that could play Doom, but I don't feel 6 weeks is enough time and it would then be out of my budget to stick with only 7400 chips so race car game it is!

Today I simulated the memory using High triggered D-flip-flops.  All the memory is just video memory, 8 bits for the car's location and 64 bits for the current view of the map.  Some things I had not though about is how to control the memory.  Addressing, input, output... all these things I have taken for granted in MCUs I am now having to design.  I am gaining a much deeper appreciation for real computer engineers.

The first challenge is making the screen scroll.  To accomplish this I made the memory resemble an 8 bit wide shift register with separate clock inputs for every row. Then I made a ring counter using rising edge flip flops and a very clever one shot device to load the initial high into it.  Each piece of the counter is tied to a row's clock pin.  The ring counter cascades the memory one row at a time starting from the bottom and moving up then repeating after reaching the top.  I need to add some sort of variable delay at this point.  The variable delay will allow the current screen to show for a moment before shifting the whole screen down again.  The delay can be decreased every so often to make the game more challenging the longer you play.  I'll come back to this.

Next is how to get the new top row of the screen into the video memory.  This is easy, the top row already has an 8 bit wide input so the signal just needs to be there when the clock is toggled.  Now I just need something to load in there... I have some Ideas for this but more on that next post.

Lastly how do I get 64 bits of data that does not have any sort of addressing system into a LED matrix that uses a row/column input?  Well, I would need 8x 8bit wide multiplexers and additional logic to drive it... NOPE, too much.  Ok, I would need to add an enable pin to every custom bit of SRAM so it could float when not in use.  This seems a little more feasible.  As I thought about how to implement this I began to notice how small the LED matrix I have is. I also began to notice how many LEDs I have laying around... a little over a hundred greens and 80 or 90 reds.   That is more then enough to build a custom matrix.  That would make it much easier to design so I think I will go with that.

Saturday, September 3, 2011

Logisim

I got started with the contest by downloading Logisim.  It is incredible!  I cannot believe how powerful this software is. I skimmed over the first tutorial (I know, reading the manual... Lame!) and was able to start creating immediately.  I highly recommend this software to anyone involved in logic design.

After the initial learning curve of this software I began to work on the game.  I quickly realized just how rusty bad I am with this stuff.  I've been using MCUs for the last few years and they have made me wasteful and lazy.  For most things I do the MCU I'm using has way more RAM and FLASH storage then I need.  When you have to build the RAM with hundreds of chips and the FLASH storage is a combination of DIP Switches and resistors you tend to look at where you can trim the fat.


Open 7400 Logic Competition

I was reading HACK A DAY yesterday and stumbled across this design contest using only 7400 logic series chips.  Reading through the rules made me feel nostalgic of my intro to computer engineering class.  So I started coming up with projects to do, clock, calculator with a full custom keyboard, game of life... all the standard boring stuff that's been done a hundred times.  I need something different, something that I would not only enjoy building and showing off to my friends and parents but something I can revisit and get enjoyment out of again and again.  Something people would want to see b/c it can give them entertainment and not just a "wow, you built that... that's neat".  If you haven't been following I'm talking about a game.

But what game?  Well, I have already come up with it but I don't want to tell you what it is, not yet.  All I will say is it will have 2 buttons, a switch and a lot of LEDs for display.  I have a LED matrix laying around from a project I did years ago that I may be able to use.  How to drive it w/o an MCU will take some thought...

I will only use 7400 ICs, not the 7400 series only the 7400 chip.  I could build the game using some of the more complex 7400 series chips with relative ease, but I am looking for a challenge.  I don't want to simply throw in a memory chip, I want to design a custom memory board or boards using the nand gates to construct flip flops for each bit I need.  I reason I need 10 bytes of memory for this game, using 7400 chips I can build a simple D-flip flop with as few as 5 nand gates or 1.25 chips.  This works out to 10 chips per byte so 100 chips just for the memory!  And that's just for the memory, not including the inputs, display driver, oscillator... this will be a challenge!

I will also do it as open as possible.  That means all open software for designing it and publishing all the files as well as lots and lots of pictures.