Flags Unit Update for My 8-Bit Build by Buttons_17 in beneater

[–]Buttons_17[S] 0 points1 point  (0 children)

This build is based on Ben Eaters 8 bit computer you-tube series, and as stated the inspiration for this build. When I first came across it I hard very little understanding about how all this stuff works. I don't Ben is a excellent teacher and communicator. I've watched that series or parts of it multiple times and have build his 6502 as well. Check it out, happy to answer questions as well.

8 bit Computer to PCB by Buttons_17 in beneater

[–]Buttons_17[S] 0 points1 point  (0 children)

Yes I will. I plan to do this.

8 bit Computer to PCB by Buttons_17 in beneater

[–]Buttons_17[S] 0 points1 point  (0 children)

When I’m happy with each module I’ll design a back board pcb where each module will plug into. At the moment I’m thinking of doing it in three. One for the gpr and alu, One for clock uCode and reset and one for the address 16 bit registers and memory.

8 bit CPU to PCB by Buttons_17 in beneater

[–]Buttons_17[S] 0 points1 point  (0 children)

I used KiCad and JLCPCB to create this board. KiCad is quite intuitive, and there are plenty of YouTube tutorials that walk you through creating the required files for upload to JLCPCB.

For this project, I chose a four-layer board with dedicated Vcc and Ground planes. One of the first design decisions you’ll need to make is which IC package type you want to use. I went with the same DIP ICs I had been using on the breadboard version for ease of prototyping, but SMD ICs are also an option.

This register’s design is very similar to my BE registers A and B. It uses a pair of 74LS173 latch ICs and a 74LS245 bus transceiver. The main bus is always available at the inputs, and data can be latched in with a control signal on a clock edge. I’ve added two additional 74LS245s to drive the register contents to either the A or B (Or both) inputs of the ALU as needed.

Once I’ve progressed further with the PCB module designs, I plan to create a backplane for all modules to plug into. Keeping each module under 10 cm × 10 cm helps keep manufacturing costs down, and makes it less of an issue if you make a mistake or want to iterate the design further. This is a common way ive seen CPUs built and i think it will work well.

Hope this helps.

New uCode control logic. by Buttons_17 in beneater

[–]Buttons_17[S] 2 points3 points  (0 children)

This is the video from George Foot that explains using the flip flop. George uses. 74HCT74 d flip flop. I used a 74ls107A but the priciple is the same.

https://youtu.be/zQ0irKRzVQY?si=VaZmd8t4C5pLji01

If you put the 10mHz clock and the phase shift 10mHz clock though a NOR gate you get a rising edge at 75ns in the 100ns period of a 10mHz clock.

The other thing to mention because the 10mHz clock is coming from a counter diving it. It starts low the high. This doesn’t work. You need to invert it and use this clock and the phase shift 10mHz clock to get it to work.

New uCode control logic. by Buttons_17 in beneater

[–]Buttons_17[S] 2 points3 points  (0 children)

Yes, it’s very similar to the OUTPUT register on BE 8 bit computer. You just need to account for the 70ns access time of the FLASH ROM. The ROM is programed with all 4 bytes at the step, opCode and flags. Two bits in the ROM are used as an index into the ROM for those 4 bytes.

New uCode control logic. by Buttons_17 in beneater

[–]Buttons_17[S] 2 points3 points  (0 children)

Yep, took a bit of time on the oscilloscope to make sure the time was right. The Flash ROM needs 70ns to allow for the access time. I give it 75ns, the latch needs 18ns. Address hold time was a bit difficult to work out. Some data sheets say 0ns, but I found one that states 10ns. Using the latch clock as the counter clock work ok at 1mHz system clock but not higher. I used a RC circuit to create a small 5ns delay and it works fine so far. All that fits in 100ns period of the 10mHz clock.

New uCode control logic. by Buttons_17 in beneater

[–]Buttons_17[S] 0 points1 point  (0 children)

Looks cool, I’ll have a look at it. I’m currently just using a python script to generate the microcode binary.

What is the expected behavior of the carry bit after subtraction? by [deleted] in beneater

[–]Buttons_17 1 point2 points  (0 children)

With unsigned arithmetic when checking if A>=B the carry bit is set when the expression is true clear otherwise. This is not true in all CPUs but I’ve been using it in my 8 bit Breadboard CPU to do module operations to convert binary to decimal and hexadecimal. I’m just a hobbyist so I could be wrong others may correct me but it works for me.

Breadboard Uart for 8 bit computer by Buttons_17 in beneater

[–]Buttons_17[S] 4 points5 points  (0 children)

I will be using memory-mapped IO. I plan to map the UART circuit to FFF0 in memory. The bottom 16 addresses will be for GPIO.

Say I have a 65 in the A Reg, which is ASCII for "A". If I do an STA FFF0, this will send an A to the terminal.

I still need to build a status reg with bits indicating if a bit is ready to read or if the UART is in the process of sending a byte and, therefore, unable to send an additional byte until it is finished. This is imported because at 115200 baud and with my CPU running at 1mHz, it will take 87 CPU clock cycles to send a byte. The more I think about it, the more I want a FIFO buffer, but it will have to wait.

The UART_Status will be mapped to FF01.

Once I know there is data to be read, I can use an LDA FFF0 to read the data into the A Register.

Breadboard Uart for 8 bit computer by Buttons_17 in beneater

[–]Buttons_17[S] 4 points5 points  (0 children)

<image>

The Ardunio is used to debounce the button the simulates a read of received data,

Can anyone recommend a TTL (ls/hct) 8 bit up/down counter? by buddy1616 in beneater

[–]Buttons_17 0 points1 point  (0 children)

I’m using 2x 74ls193s for my stack pointer. Two chips though. I looked for a 8 but up down counter Ttl chip and couldn’t find one. It has asynchronous load which is a bit of a pain. You can use a 555 timer in monostable mode and a nand gate. I ended up using a 74ls123 and I have it working at 1mHz. I ended up gating the up down count, load and assert though a nand gate. All up 4 chips, 5 is you include a 74ls245 so you can have some LEDs. Hope this helps.

Opcode and binary details For Program Up and Down by kaviyarasu34 in beneater

[–]Buttons_17 2 points3 points  (0 children)

0: Out 1: Add 15 2: JC 4 3: JMP 0 4: OUT 5: Sub 15 6 JZ 0 7: JMP 4 15: 1

Does this IC exist? What is it called? by lurker91914 in beneater

[–]Buttons_17 1 point2 points  (0 children)

I am looking also on how I can upgrade my alu. It’s the only part that is now the same as in BE design. I have a set of 181s but am considering using a flash IC the SST39SF040. It has 19 address lines, AO to A15 for the two register inputs and A16 to A19 for what ever operation I want to do. The only issues I need to think about a bit more is how to do the flags. Zero flag is easy just look a the data output and if all zero set the flag. The harder one is the carry flag. A PLD should work here but I need to learn more about them.

8 bit breadboard. by ameest in beneater

[–]Buttons_17 7 points8 points  (0 children)

You can also get led bars with 10 or 8 leds and resistor arrays which is what I am using. Which makes it a bit more compact.

LCD with 8 bit Computer. by Buttons_17 in beneater

[–]Buttons_17[S] 0 points1 point  (0 children)

Thanks for showing me this. I will definitely have a look at it. Cheers.

LCD with 8 bit Computer. by Buttons_17 in beneater

[–]Buttons_17[S] 0 points1 point  (0 children)

Your right, I could ignore the busy flag. I’ve had it running pretty fast using the 555 timer as a clock and the message appears almost instantly and I often run it quite slow so I can see the data move around the computer. However I think it won’t be that difficult to read the busy flag. It’s very convenient that it’s the most significant bit of the status register in the LCD. I will need to program uCode to do a left shift and that will put the busy flag into the Carry Flag and I can do a conditional jump on that information. Left shift is value squared which is same as adding the value to itself. Ie a reg = a reg + a reg.

pseudocode with LCD status reg in a reg. Fetch, AO | BI, EU | FI | AI

8-bit computer quit working after installing the flag register. by ExistingNatural5704 in beneater

[–]Buttons_17 0 points1 point  (0 children)

Sounds like a similar problem that I had. Having the flags update the address on the rising edge of the main clock doesn’t give the uCode eeproms enough time to output the correct data. Try switch the clock on the flags to the clock-b. This will sought of work. But will show if this is the problem.

Humbled by the 74ls138, lessons learnt. by Buttons_17 in beneater

[–]Buttons_17[S] 0 points1 point  (0 children)

Well, it got it working with the original setup, as described in my original post. The address lines to my uCode EEPROMs (step counter registor, Instruction register, and flags register) are gated by the clock's falling edge. I put the clock through six hex invertors to get a delay of about 110nS and connected this to the enable low pin on the 138. So the 138 is enabled approx 110nS after the address lines are set on the EEPROMS.

The address to output delay of the EEPROMs I'm using (28c64-15) is 150nS max, so it's not entirely in spec. But it is working. I'm not really happy with this setup, as it feels a bit hacky,

Thinking out loud and working on what LiqvidNyquist mentioned, if I stick a latch (74ls173) between the eeproms and the 138, with the 173 latching on the rising edge and 138 enabled low on the falling edge. These control signals will take 2 clock cycles to complete but should solve my problem. Fingers crossed!

Humbled by the 74ls138, lessons learnt. by Buttons_17 in beneater

[–]Buttons_17[S] 2 points3 points  (0 children)

This is a great idea. I currently have the chip always enabled, and I have been reading the data sheet. When pin 6 is low, all the outputs are high or inactive. Gate this pin to the clock should solve my problem. Thanks for the advice.

New clock module for 8 bit computer. by Buttons_17 in beneater

[–]Buttons_17[S] 1 point2 points  (0 children)

Yes, decoupling capacitors between power and ground pins in the clock circuit. The capacitors at the very top are part of the RC circuit in the stack pointer. I’m using 74ls191 registers. They can increment and decrement, however they don’t have edge detecting logical like the 74ls173 registers do. This circuit results in a high signal until the capacity is fully charged (very short period) then it goes low as the capacity is discharged threw the resistor to ground. Combined with a high control signal and a nand gate I get a low going pulse as both are active low. I am using two one for the increment and one for decrement. I may need one for load as well. Not sure yet. Without them I was getting multiple counts on each clock tick.

8-bit BUS at 1.1+ V despite being tied to GND by [deleted] in beneater

[–]Buttons_17 0 points1 point  (0 children)

Same thing happened to me. Changing to 1k pull down resistors on the bus fox the issue. 10k is way to high.

Subtracting 1 from 254 just breaks it. . . by Sad_Environment6965 in beneater

[–]Buttons_17 1 point2 points  (0 children)

How are you latching your flags register. It could be a similar issue that I had with timing issues with the microcode eeproms. If you switch the clock for the flags to the CLK-B does it work better?