Close

Day 3: Setting and Resetting

A project log for Detritus, the 8-bit ... computer?

I have a lot of random spare parts doing nothing and a need to make them do things...

jorj-bauerJorj Bauer 05/19/2017 at 11:170 Comments

Day 2's fun ended with an odd counter problem - where the carry from the low 4-bits of the program counter is being applied to the high 4-bits one clock cycle too early. As fun as it is to count "14, 15, 31, 17, 18" I'd much rather that my computer counter "14, 15, 16, 17, 18" like all the other computers. So my task for today, then, is to delay the application of that carry bit by one clock cycle.

The DM7474N is a dual D-type flip-flop. It's easy to use a D flip flop as a 1-bit, 1-cycle delay. (I had indeed forgotten that the 'D' stands for "Delay", even. Thanks Google.) But instead of that, here I grabbed a DM7476N dual J/K flip-flop, and convinced myself that I remembered how to use one as a delay instead of a D-type.

After about a half hour of confusing the hell outta myself, I went back to the obvious choice and built it out of a 7474. :)

Now the counting logic looks like this, with the flip-flop delaying that low carry by one clock cycle:

High bitsD Flip-Flop out ("Q")D Flip-Flop inLow CarryLow bitsOutput
000000010008
000000010019
0000000101010
0000000101111
0000000110012
0000000110113
0000000111014
0000011111115
0001100000016

But there are *two* new ICs in the clock module. What's the other one?

I played for a little while with reversing the two ICs - using the '193 as the low bits. Immediately there's a problem, because the carry out from the '193 is active-low. So I needed an inverter while playing with that configuration. The MM74C04N from my pile of parts did just fine.

I've also connected the output of the full 8-bit program counter to the bus using one '241, which is seemingly designed as a bidirectional 4-bit bus interface (not a unidirectional 8-bit bus interface). The two separate enable lines on the '241 have opposite control logic: one requires a low signal to enable, and the other requires a high signal. If you were using this as a bidirecitonal 4-bit control, you could tie together the two; if the logic were high, you'd be flowing in one direction across the chip and when you switched to low, you'd be going the other way.

Since that's not what I'm doing - I only care to gate the output, tri-stating *to* the bus, not worrying about what comes *from* the bus just yet - I should probably tie those two together to one control line via an inverter. So it's wired to the hex inverter '04; when one line is low, the other is high, and I can turn this on and off as a single unidirectional 8-bit switch with just one control line.


Discussions