r/beneater • • 10d ago

8-bit CPU Testing registers problem

Im afraid im stuck. Ive wired up register a and register b along with the ALU. Im trying to test the registers first before moving on to test the ALU. Ive sent a signal to the bus (using red jumper wires) 10101010. This is clearly on the bus because the bus leds light up to confirm this. The problem i have is that the leds on register A dont match the leds on the bus. Register a shows 01010101.

Im concerned with fixing register a at the moment. Can anyone say why the leds dont match what's on the bus? Register b seems to have the same issue. The first bit should be 1 but it shows 0.

What is the correct procedure for testing both registers?

43 Upvotes

5 comments sorted by

7

u/The8BitEnthusiast 10d ago

As a hard rule, when you hard wire the bus bits to vcc or gnd with these red jumpers for the purpose of inputting a value into registers, ALL outputs of the LS245s on the board must be disabled, i.e. their pin 19 must be connected to Vcc. On the picture, it looks like the 245s on reg A, reg B and ALU are enabled while the red jumpers are connected. If I'm right, this creates a potentially damaging electrical conflict on the bus. Make sure you disable the LS245 outputs when using the red jumpers to "set" values on the bus.

It also seems that the LS245 wire connections to the bus are reversed, which would lead to reg A and reg B values to be reversed as well when loaded. For instance, LS245 pin 11 should connect to the least significant bit of the bus (far right).

It looks like you did OK loading a value in the registers, so with the these two things fixed, you might be good. Just remember to always disable the LS245s when manually entering a value on the bus.

Hope this helps

1

u/z80RM 9d ago

I got it working now. Both register a and b display the correct bit patterns. You were right, for some reason id mistakenly wired the connections in reverse order. Thanks for your help.

1

u/The8BitEnthusiast 9d ago

Registers look good! You might need to double check the ALU. The lower four bits show an incorrect value - should be 1110. Top four bits look OK though, so I think this could be a wiring issue to the corresponding LEDs.

1

u/z80RM 9d ago

It doesn't seem like a good sign if the ALU is displaying incorrectly. I dont understand how to test the registers and alu. All I did was enable register a to read data off the bus. The current outputs of the alu and b registers - I hope - are just random output.

2

u/The8BitEnthusiast 9d ago

Well, in the latest picture, the 'load' wire on reg B appears to be grounded, so it also loaded the same value from the bus. The ALU output is never random since it continuously adds reg A and reg B. So, in the scenario you ran, you loaded 1010_1111 (175) in both registers. The output of the ALU will be 1_0101_1110 (350). The far left bit is the carry, which is hidden for now. On the picture, the ALU value shown on the LED is incorrect for two bits. Could just be a wiring problem with the LED.

To verify the ALU, best thing to do is to take voltage measurements on the adder ICs and compare that against expected logic levels. I always use the schematics to first predict what logic values should be on each pin, and then verify that on the physical circuit.

Happy hunting!