# Galactic Electronics Projects

## 4 bit CPU - Programming Interface.

The programming interface is a simple toggle switch / LED type. Since programs written for this 4 bit CPU are relatively simple and small, the toggle switch /LED interface works well and is not as difficult to use as one may think.

Programmer -

The toggle swithes are connected to 74LS244 buffers. The buffers are in high impedence state at program run time and reset mode and are active during programming mode. The memory address, instruction and program data are input through the toggle switches. There are another set of 74LS244 buffers used to drive the LEDs. These show the memory address, instruction and program data both during programming and program run time.

The contents of the accumulator and flags register are also displayed during runtime through 74LS244 buffers at program run time. This is useful when testing and debugging programs. The lowest clock speed (10 Hz) is necessary to observe the accumulator and flags during program testing.

Control -

There are three modes of operation : run, reset and program. A program may be loaded into memory when in program mode and of course the program run in run mode. Reset mode holds the entire CPU in reset. Reset mode is the center position in the three way rotary switch so that the only transition from run mode or program mode is through reset. The CPU is in reset mode during programming mode as well. The address and instruction LEDs will glow in reset mode because everything in the CPU is in high impedence state at this time.

There is a write button to write an instruction and data to memory while in program mode. The write button will also write to memory during program runtime so one must be careful not to press the write button during program execution.

A 74LS240 is used for switch de-bouncing. Although the 74LS240, '241 and '244 are buffers, they are also Schmidt triggers and work well for de-bouncing switches and buttons.

Construction notes -

The control panel is made from 3/32" aluminum sheet. This material is easy to cut and drill with hand tools. The aluminum sheet was purchased from a local hardware store.

The control panel shows controls and LEDs not used in this 4 bit CPU for they were installed for an earlier and abortive version of the CPU. These are the zero flag indicator, step button and step / cont switch. The button and switch were meant for a single instruction execution mode that was deleted from the final version of the CPU to reduce complexity, as was the zero flag.

The power switch and pilot light are also not functional. I haven't yet built a power supply for the CPU and I currently run it from an external power supply.

One of the pictures shows the toggle switch board and flags / accumulator display board. The toggle swithes are installed on a board along with the 74LS244 buffers and LEDs. The LEDs were soldered in only after the switches were attached by nuts to the panel and the LEDs they were positioned in their holes in the panel. This ensured the proper distance from the LED and board. The same technique was used for the flags / accumulator displays after the board was attached to the stand-offs.

The connectors to the CPU board are DIP headers. An 8 header is used for the control interface and a 16 pin header is used for the address and instruction interface. These headers connect to the empty sockets on the CPU board.

Send questions and comments to WireHead@GalacticElectronics.com

(c) Jon Qualey, December 2006

Back to 4 bit CPU Home