Intel 8008 #147
jdaless
started this conversation in
Show and tell
Intel 8008
#147
Replies: 3 comments 1 reply
-
Thats pretty amazing, how long did this take to design and setup? |
Beta Was this translation helpful? Give feedback.
1 reply
-
That's extremely cool, thanks for sharing! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey i just joined in and i and interested in upgrading that CPU from I8008 to its succesor (I8080). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
8008.zip
Introduction
Wanted to make an 8-bit CPU, decided to work based off of an existing design that was decently simple (and fun!) to implement. Worked mainly off of this data sheet. There's probably optimizations to be done and it would absolutely be easier with some kind of externally programmable memory, but it is functional enough to run the test program properly. The data sheet includes some information about peripherals, but I just whipped up a couple chips for making testing easier. This took me more than a week so I wasn't trying to go overboard, and the rest seems trivial compared to the microprocessor itself. I am a few steps from the MCS-8, though without ROM/RAM of course.
About the 8008
The 8008 has 7 registers (A, B, C, D, E, H, L) and a virtual register for accessing memory. The virtual register ("M") contains the value at the memory address specified by H and L (high and low bytes of the address, respectively, though the most significant 2 bits of H are unused since memory addresses are only 14 bits). The ALU will always operate on an operand and the accumulator (A register) then store the result back into the accumulator. To do this, the 8008 has two special purpose registers (a and b but that's confusing so I call them α and β) for internal communication. There are three "groups" which are each multiplexed: the 8 register stack and 7 "scratch pad" registers are what I call the "Memory Group", the special purpose registers and the ALU which I call the "ALU Group" and then the instruction register, decoders, and state control, which I call the "Decode Group".
Actual Architecture
From here
My Implementation
Using it
It is currently functional, with a few known issues:
00 AAA 101
is equivalent to01 XXX 110
00 AAA 000
00 000 000
anyway.It can run the program in appendix 3A though, if you're patient enough to be the memory. If you'd like to take a shot, open up this sample memory I've transcribed from the data sheet:
"Sample Program to Search A String Of Characters In Memory Locations 200-219 For A Period"
How to use:
RESET
to high for a few seconds then bring it low again.Wait
is high, read the bottom right output* If
Instruction
orRead
, enter in the byte at the displayed memory address and bringReady
to high.* If
Write
, write the byte shown on the top right to the displayed memory address and bringReady
to high.* If
Command I/O
, I'm not sure what to do since I haven't implemented INP and OUT properly.Wait
is low, repeat step 3.Highlights
Scratch Pad
Register 000 is the Accumulator, which is a shift register, as opposed to 001-110 which are increment/decrement registers. Register 111 doesn't exist and stands in for memory access. I needed a indexing system to put those addresses together in the scratch pad, but still uniquely index all the addresses properly. So, first division is by
A2 xor A1
, then the second isA1 xor A0
, then the last is just the last digit, like a normal address. This put 000 and 111 in the same region! More specifically:000
0
0
0
000
001
0
1
1
011
010
1
1
0
110
011
1
0
1
101
100
1
0
0
100
101
1
1
1
111
110
0
1
0
010
111
0
0
1
001
Stack Pointer
The 8008 has an 8 byte internal stack. Instead of going in order (push 001 to 010, pop 001 to 000), it uses a de Bruijn sequence. I was able to implement that with the logic here. This "Shifter" component will therefore produce 8 addresses in sequence, in either direction. Pretty neat!
Hex Display
I used logic friday to design a component for printing hex values on the 7-segment displays instead of just decimal ones. This makes multi-byte-sized data readable without needing to double dabble or anything.
Instruction Decode
This one got kinda gnarly, an 8008 instruction can take up to three cycles depending on how much data it needs. Each cycle has up to 5 states. So, every instruction needs behavior in any of those states that it'll hit.
Beta Was this translation helpful? Give feedback.
All reactions