Help needed

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
Hi everyone

The computer was a disaster for the instruction set was just too poor, si i have designed a new one:


BINARY OPCODE DESCRIPTION
00000 nop
00001 add add register n to a
00010 sub subtract register n from a
00011 and and logic on a
00100 exor exlusive or logic on a
00101 or or logic on a
00110 not not logic on a
00111 load load value n into register defined by m
01000 loadreg load value at n reg into m reg
01001 jump jump to address nm
01010 compare compare reg a with reg n or word m
01011 jump a<b jump if less flag on
01100 jump a=b jump if equal flag on
01101 jump a>b jump if greater flag on
01110 jump a<>b jump if greater and less flag on
01111 stop stop progam
10000 display display reg n at location m
10001 call nm jump to nm and note the return line
10010 ret return

INSTRUCTION : 5 BITS
NOTHING YET
WORD N : 4 BITS
WORD M : 4 BITS

the memory chips accept 8 bits in one go.
So a full line of code takes 2 bytes.
The first byte stores a 5 bit instruction code
THe second byte stores two four bit words, n and m

i want to make this computer very flexible
dont ask about carries, im not having them (i dont think anyway)

is this flexible enough to make programs?

there are 16 registers, 0 to F
if the description says register n it means the register at location n,
so if n was 1111, the register is F

the computer can only do one subroutine,ie no subroutines inside a subroutine
there are a few digit displays

also, can someone help me with this SRAM:
http://www.farnell.com/datasheets/63505.pdf
I want to know what to do when to do, like a list:
clock cycle
1) set addres
2) set data
3) set pin one high

Thanks, you guys rock!!!
 

Wendy

Joined Mar 24, 2008
23,429
One of the core problems you had was not paying attention to the fundimental structure of binary. We use hexadecimal and other tricks, but first and foremost a computer is bits and bytes.

Their is a reason why an 8 bit computer chip has 16 bit addresses, it makes making a CPU much easier, since 2X 8bit words make a 16 bit address.

If you want to make a 4 bit computer think 8 bit addressing to start off with (I know, 256 RAM is a pain) and 4 bit data sizes. Commodore and later computers got around this requirement by using banking, switching of whole blocks of RAM, to increase the RAM size. I might be mistaken, but the IBM XT did something similar. It used another 8 bit processor, the 8088 (also the 8086 in the beginning).

Have you looked up a 4004 on Wikipedia? I know you want to do this yourself, but it is silly not to refer to prior art.
 

Kermit2

Joined Feb 5, 2010
4,162
Is no one going to help me?

Can someone please help me with this SRAM:
http://www.farnell.com/datasheets/63505.pdf
I want to know what to do when to do, like a list:
clock cycle
1) set addres
2) set data
3) set pin one high
I'm not sure I understand what you are wanting to know. the timing and sequence requirements are on pages 7 to 9 of the data sheet you linked ???

CE can be enabled continuously, OE can be left as a low all the time and you merely toggle WE high and low to read or write. It's all in the data sheet
 

Kermit2

Joined Feb 5, 2010
4,162
you know what, never mind.
Just dont bother

There's that can do attitude that made America great!
Someone new comes along and tries to help and you slam the door in defeat.

Go back and look at the data sheet. Go to the library and get some books. OR just quit and go play videos. Leave the programming to people who want to TRY and do it
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
I have never had an electronics lesson!
I have tough myself everything,
I just have problems understanding these diagrams!

This is what the should have said:

clock cycle:

write:
1) set address
2) drop CE
3) drop WE
4) set data
5) raise ce, we
6) done

read:
1) change address
2) drop ce
3) drop OE
4) raise CE
5) raise OE
6) done

they can add diagrams later on but this should be said so the basic person can understand what needs to happen when. Infact i just managed to read those horrid diagrams
Sorry for being short tempered, not been a good day :(
 

Kermit2

Joined Feb 5, 2010
4,162
Like I said, the Chip Enable and Output Enable can just be tied to ground while operating. You only need to toggle the Write enable high and low to read and write to the chip.

Have you made any circuit diagrams or schematics of your layout yet?
 

retched

Joined Dec 5, 2009
5,207
I have wrestled with this type of memory and failed.

It was so very difficult for me to wrap my head around. SPI and other types of interfaces are now available for eeproms and such that make it a world easier.. or at least less of a head ache.
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
hey bill, it does 8 bit addressing :)
i learnt all of this on my zx spectrum!
it uses an 8 bit cpu but uses 16 bit addressing

i could push it and take advantage of the two unused bits and use them in addressing :rolleyes:
 

Wendy

Joined Mar 24, 2008
23,429
I seem to remember your design having a addressing scheme a different length than the data length. What was it, 12 bit addressing with 4 bit data?

If I'm remembering correctly this means your JMP instructions will have to be 4 bit commands. Normal CPU use JMP LOW HI, yours would be JMP LOW MIDDLE HIGH. That is if I'm remembering correctly.

I looked hard to find a datasheet for a 4500 processor. That was unique chip (and the first number used in a venerable logic family), it is a dang shame the information is gone on it. It was referred to as a single bit processor, and it used a 8 bit ripple counter (also a 4500 series chip) that simply toggled through all the states. For jump instructions it simple turned off until the address came up. Not too sophisticated, but very simple logic wise.
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
So can i just confirm with experts,

I just connect CE and OE to ground
To read i just keep WE high and change address
To write i just set my data on the IO lines and toggle WE?

Thanks!
 

marshallf3

Joined Jul 26, 2010
2,358
So can i just confirm with experts,

I just connect CE and OE to ground
To read i just keep WE high and change address
To write i just set my data on the IO lines and toggle WE?

Thanks!
Sounds correct to me, most of these were active low devices.

Some of the older chips still have interesting uses to this date, for example I've still got and am not afraid to use old 27C64 EPROM chips to create simple conditional circuits. The 64 was a rather small chip at 8K x 8 - much larger ones were built and still available - but you could program in a simple logical circuit then erase it if you didn't like the way it worked. You didn't even need a CPU to make useful circuits out of them.

Seems I've got a whole box full of the things somewhere along with the hex keypad programmer and UV eraser.

Too bad they're trying to cram so much into a degree nowadays, understanding how these things worked was easy and would probably make understanding what follows make more sense.
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
Ok, i have made the circuit below and here is what i get:

Uploaded with ImageShack.us

I keep WE high (forgot to put that in the schematic) but i connect it to a switch which is kept high with a pull down resistor. I set my data and then toggle WE. It seems to remember the number because i can set my data pins to 0 and it still shows the number. However, I cant read, if i change the address to something else and then go back to the original it just does not show anything...


All resistors here are 1 M ohm. The voltage input is 5V and thats it...
SO:
I set my data and toggle WE, it seems to remember it

When i read i just change address but nothing...
Can someone post the correct schematic

PS the chip shown is not the same one, it does not have the second CEm just the one,

Thanks
 

kubeek

Joined Sep 20, 2005
5,795
You are missing resistors on the leds, you will fry them this way. Also the power supply for the IC is missing, and a decoupling capacitor would be good too.
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
Its a little obvious about the power supply!
OF course i connected that silly :p

Its just appears that the read does not work :(
I am correct in saying that to read, just change the address, right?
 
Top