Digital Systems Portfolio

Eli Onufrock

Created for ENGIN-2213: INTRO TO DIGITAL SYSTEMS

Professor Alyssa J. Pasquale, Ph.D.

College of DuPage 

DISJOINT WINDOW DETECTOR/SYNCH DETECTOR

The centerpiece of this circuit is  a disjoint window detector that detects the sequence 001. The detector is then coupled with a circuit that generates the same sequence, with the intent that the detector's output can be used to determine whether the two circuits are in sync. 

The detector was originally going to receive a two-bit input, fed off of a corresponding two-bit counter. A quick check in LogicAid, however, suggested this was not entirely feasible given the amount of breadboard space and time available to me. 

A second version with only one bit to deal with proved much more reasonable.

To determine the state assignments, I focused on the inputs and tried to set markers in the state assignments that could indicate what the output should be. Ideally, state 1 and state 2 would be have something in common that differentiated them from state 2:

After a couple of test versions, I settled on the assignments to the left, with bit 1 signifying "good path"/"bad path" and bit 2 signifying 

The initial circuit was designed to output 1 whenever the circuit was on the "good path." After building it, however, I realized this caused false positives, for example, with the sequence 000. A change to the output logic soon rectified this, although it did cause the less significant problem that the outputs of a matched sequence matched the inputs, making the sync check less interesting to watch. 

STORE CHECKOUT

This circuit is an exercise in using ROM to control other parts of a circuit. The idea is it performs a series of steps depending on a three-bit input corresponding to (fairly arbitrary) things that might happen at the checkout counter of a department store:

Inputs of 1 on any of the bits mean that the corresponding action should happen. In the non-active state, this sends 1 through a mux into the J of the relevant flip-flop, where the circuit's actions will be taken. The inputs also set the 3 most significant bits of the ROM, determining which instructions will be carried out. Pressing go sets a latch that enables the clock into a counter that progresses through the ROM instructions as well as switching the muxes on the flip-flop inputs to let through the ROM instructions. 

Preliminary sketch of the input section

Programming the ROM, I went through the different combinations of inputs, charted out what needed to happen, and programmed the memory to give the required outputs. A list of which hex codes corresponded to which outputs proved invaluable. 

During testing, I observed that the value of the flip-flops when the sequence started did not always match the value of the inputs—the inputs went to the J of the flip-flops and so could only set, while K was connected to a separate reset button, so the flip-flops remained 1 while the input changed to zero. I put a more limited  reset state at the beginning of the code to start the sequence by setting the flip-flops to match the inputs and moved the other resets to the last available output. 


PRIME FACTOR DISPLAY

This circuit uses multiplexers to implement logic identifying whether numbers between 1 and 15 have prime factors of 2, 3, 5, and 7. 

Using muxes was more effective for some of the outputs than others. 2 is more complicated with the mux, as it would otherwise only have been simply F=D'. 3, on the other hand, simplifies as a normal equation to A'C(B⊕D)+AD(B≡C)—much less friendly than the mux circuit which only needs two gates. 5 is similar, needing only one gate instead of the four needed (without fan-in limitations) for A'BC'D + AC(B≡D).

PUSH BUTTON INPUT FSM

One of the challenges faced in the semester's design project (a version of the electronic Simon game) was how to compare a stored (and static) value with the changing value entered via pushbutton. 

Registers, latches, and flip-flops seemed like possible tools, but the major breakthrough didn't occur until we covered finite state machines. Since we needed a system to hold the inputs, make the comparison, and move on, a FSM seemed like the perfect tool and I set to work. 

Having determined three variables that could affect state changes and outputs (since at least one of the outputs would have to depend on the result of the comparison, a Moore machine was never really an option), the transitions had to be figured out. Fortunately, only one of the variables really affected the movement: Had a button been pressed? If so, the circuit would move to the comparison state, give its outputs and transition back. 

The original version only had two states, one waiting for input and the other making the comparison. The latches the button presses were entered into, though, needed to be reset at, and the reset signal couldn't simply be taken from the flip-flop or else the latch in input state would never actually hold the value. 

The solution ultimately was to add a second state during which the latches could be reset. As the state movements were still fairly straighforward, I started from the state table, and while I discovered as I was building the simulation that I had mixed up M and C while putting together the outputs, the circuit ultimately functioned as desired. 

SEQUENTIAL DROPPER

This circuit is inspired by the gradually dropping bars found in audio equipment as a spectrum analyzer/graphic equalizer visualization or a level meter. 

From left to right, the push buttons trigger 1, 2, and all 3 of the stages as 1, then the outputs in sequence (right to left) return to zero. The push buttons could be replaced with connections to the outputs of a decoder if the circuit were to be integrated into a larger system. 

The circuit's development began with a simple drawing to think through the basic logic. Since each stage's state simply depended on the following stage's state, a rough circuit structure using D flip-flops soon presented itself, and a test in CircuitVerse brought it into working form. 

The next question was how to set the flip-flops to 1. Experiments with the preset pins failed—although had I been working at a breadboard or more familiar with the workings of CircuitVerse's flip-flops I may have used them—and I arrived at some fairly simple input logic: Since the goal is to set the flip-flops to one on the button press, and the circuit uses D flip-flops, all that needs to be done is to be able to make D one either when the next flip-flop is one or the button is pressed. 

The circuit during input setting testing

The resulting circuit accomplishes this with an OR gate between the button press signal with the looped flip-flop outputs, allowing either one to set the flip-flop to 1. An SR latch with the button as set and the clock signal as reset eliminated the need for the button to be held until the clock ticked. 

Additional buttons were then added following the same logic, with one ORed into only the first and second flip-flops, and one into only the first.

GRID COORDINATE DISPLAY

This circuit takes as inputs two-bit binary x and y coordinates and displays them on a 4x4 grid of LEDs. 

Each coordinate is put through a 2 to 4 decoder to give one row/column a HIGH value, then AND gates connected to each LED select only the point that matches both the x and y values.

CircuitVerse's decoders are extremely limited—1 to 2 with no enable bit—so it was necessary to expand them using demultiplexers. The 1 to 2 decoder works for the first stage of the decoder, then the second stage is comprised of a 1 to 2 demux on each output using as a shared control bit the LSB of the coordinate.

COMBINATION LOCK

If latches were called something different, I might not have made this circuit. The original idea behind it, inspired by the term "latch," was to create something that behaved like a keyed door lock, where the key, or in this case the combination, was used both for locking and unlocking. The state of the lock is indicated by an LED, with off being "locked" and on being "unlocked."

The design process began with a basic outline of how the circuit would function: 

Problem one was how to make a circuit that would alternate between 0 and 1. The logic of an experimental circuit (shown to the left) did not work out, but after a day or two of occasional research, I discovered by working backward from the section on counters in Thomas Floyd's Digital Fundamentals that there was a device, the JK flip-flop, that had a toggle setting that could work in the circuit if the clock signal were replaced by the "unlock" signal. 

Playing around with the 74112 chip and and switches showed that switch bounce was a major problem for a circuit connected in this way. Connected to a regular clock signal, the chip behaved normally, but the results were erratic when the clock was replaced by a switch or by some simple logic used for testing. In the final circuit this was overcome by putting the unlock signal through the second part of the 74112 set up to work as a D flip-flop. 

The testing breadboard

The circuit was originally set up with the set code stored on DIP switches. After wiring the circuit up, though, it looked like a much less interesting circuit than it had originally seemed it would be, and having some extra time I decided to move the stored code to a 74194 PIPO register. 

Another addition during assembly was a push button connected to the clear pin of the lock flip-flop to "lock" the circuit without the user having to re-enter the code.

8-4-2-1 BCD DECODER

This circuit takes a 4-bit input and, for numbers 0-9, displays them on a seven-segment display.

It is designed for ease of understanding rather than as an optimum circuit to be built—each segment is decoded separately and built in CircuitVerse as a subcircuit. Since it was my first circuit, I did it this way as an exploration of how CircuitVerse worked. (We also hadn't covered circuit optimization in class yet, either.)

Segments were derived via Karnaugh maps (shown below), plus some trial and error as the circuit was being put into CircuitVerse.

2-BIT TWO’S COMPLEMENT MULTIPLIER

Would you rather not multiply by 0, 1, -1, or -2 by hand? Well, this circuit can do it for you. It accepts as inputs two two-bit numbers in signed two’s complement form and returns a 2-bit product (the red LEDs). 

Since the overflow bits are simply copies of the sign bit, there are only four possible products of individual bits: A₁B₁, A₁B₂, AB₁, and A₂B₂. The circuit then plugs these values into the proper places and adds them. 

Overflow is detected by checking equivalency of the sign bit of the output and the two (undisplayed) overflow bits. With no overflow, the output will display normally. If there is overflow, the output LEDs will not illuminate (accomplished by ANDing them with the active-low overflow signal) and the overflow LED lights up. This portion of the circuit was mostly designed at the breadboard, so little written documentation exists for it. 

NAND-only Adder

I found the idea that a single logic gate can accomplish any operation fascinating, and so for my third circuit I created a ripple-carry adder using only NAND gates. (If they can
get us to the moon, surely they can do
basic arithmetic!)


The circuit was originally going to be based on the adder we made in lab, but for much of the logic it was easiest to go back to the truth tables and rederive minimum expressions without XOR, then convert to NAND-only via the bubble method as shown