My 74LSxx logic-based 8 bit computer project - Page 1
Forum section: electronics / projects

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 01:16:14 pm
content: Hi everyone!Why should i build a 8 bit computer?Why not? Well, I was always interested in electronics and mainly computers. Now, i've received a bunch of 7400 chips (I've got more than 150 of them!) from one of my friends for FREE!I might be able even to get more of them, coz his father worked in the fab company, so he said they have the chips everywhere... So I was wondering what to build... And my love to computers made me go for this project.I'll think I'll also make a nice front panel with switches and LED's for the nice'blinkenlichten'There are some preliminary specs of the CPU:(more in the attachment)Architecture:Von Neumann, RISC architectureWord width:16 bit (4 bit opcode, 4 bit reg adr, optional 8 bit argument)Memory/IO:Shared, I'm thinking about using an 8kB EEPROM, 32kB RAM, and the rest for the IOInterrupt channels:NoneRegisters:8 GPR, 1 16bit register, 2 Rot. registers, 2 ALU input regs, 1 ALU output, 1 Flag reg.Additional features:None atm.Etc...SEE ATTACHMENTS!Current status:This project is now mostly in the 'paper' stage, I'll work on it in the following months I hope...This project is now more in the 'Eagle' stage, I think i'll build it after the holidays.CPU instruction set design:100%NOWREALLYCOMPLETELY REDESIGNED!Build progress:0%, i need a better soldering iron (I'm using a 30 year old gun one now, which burns the wire on it every 10 minutes...) and a bunch of wires...i was thinking about wirewrapping too, but i can't find any cheap enough wirewrapping tools here...Gonna solder it.I was also thinking about which peripherals should i add...My current must-have peripheral list:RS232 terminal (emulated on my comp)quad 7 segment displayBlinkenlichten! (LED's)hex. keypad (custom made, because the ready-made ones cost a shiftload of money and look awful)and probably more, suggest something...I will release full schematics and netlist when it's done, so some other similarly-crazy guys could build it at home aswell...I've attached a kind of a datasheet for this CPU there, so feel free to download it and maybe write something for it!Update:I'm now working on this project with one of my friends. However, he doesn't live anywhere near me (he's dutch), so we'll end up making 2 of these computers at least.Also, the computer's now sorta based on my xRisc 3B architecture.Finally, I've got the FPGA now to test some stuff, so the development should move really quick now.

author: SeanB
author_rank: Super Contributor
timestamp: March 31, 2013, 02:00:31 pm
content: I would suggest 6116 for the ram, easier to get. For the program memory use a few flash proms, easy to program if you use a set of ZIF sockets, or add a set of analogue switches to flip between run and program via a cable to a programmer. You will need a pretty big 5V power supply, this amount of TTL will need around 30A or more at 5V, probably best met by the old fashioned method used on S10 bus cards, a global 8V supply ( or nowdays a 6V supply as you can get good LDO regulators) and on board regulators to give 5V per card ( or a few to drive each part if they are over 2A with a LDO capable of giving 2A from 6V) reliably. Doing it on card frames makes building each section easier, as you can test each part then integrate them together with a higher confidence level, plus you can buy protoboards on eBay that plug in to a bus.

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 02:13:22 pm
content: Oh, thank you for your suggestion. I'm going to use the 2114 because I already have some... I was thinking about putting a PIC there to act like a program ROM, and that PIC would be connected to PC with a serial link, so I could upload the program there and debug it and so...Quote from: SeanB on March 31, 2013, 02:00:31 pmThirtyAmps?Are you sure? Icc max is 22 mA for the chips according to the datasheet, so that gives around 3.5 A in total for 150 chips plus some other stuff around... I might also use some power FET's there to switch off the unused logic or something...I will probably use an old computer PSU there, coz i actually use one with screw terminals as a simple bench PSU...And yeah, I was thinking about the multiple board construction too, and I am actually going to use it...

author: C
author_rank: Super Contributor
timestamp: March 31, 2013, 03:25:57 pm
content: You may find some of this on the net, but here might be easer for you.The PDP-1116 bit with 8 general purpose registers. The main part of this computer was the 74181 arithmetic logic unit, with the inputs connected via 16 to 1 data selector and outputs a 1 to 16. If you could get in to the minds of the designers, you might think that they designed it backwards. The PC and SP register were not thought of first so to speak but were more an allocation of a general purpose register to a specific need later. The arithmetic logic unit could get it's two inputs from any two registers and output to any register. To make the design even easer inside they used even more general purpose registers. The registers the programmer could see and the internal hidden general purpose registers. One of the hidden registers for example got allocated to supplying the address that appeared on "UNIBUS" the main memory/io buss A second for data to for the "UNIBUS". followed by one for interrupt address, one for interrupt level, ... If you look real close at the PDP-11 instruction set you will find that there are really no special instructions for the SP and PC registers, they just gave special names to something any of the other registers could do. They used K.I.S.S to the extreme.Total Asynchronous design: With a simple little test board you could actually repair a PDP-11 with a volt meter or logic probe. There was no main crystal. If you think about it, some processes in the CPU take longer times to complete then others. In one of the fields in the microcode was the selector for what tap of a delay line to use to start the next step in the microcode process. Note that one of the choices was external. If a "UNIBUS" write was needed, it would update the "UNIBUS" address and data registers, select the external time delay and STOP( DIE ). The memory/io sent a signal to start the next step. For a write it was "I GOT THAT", for a read "Data will be ready by the time you can read it". Of course this created a problem with no memery/io, but there fix was also neat an simple, generate an interrupt on time-out and use it's next step to start the CPU again. As a side effect, they gained a way to test for IF memory/io exists.Any way thought this might give you ideas or help.C

author: grumpydoc
author_rank: Super Contributor
timestamp: March 31, 2013, 03:30:36 pm
content: QuoteI don't think he'll need a 30A PSU, mostly because I doubt he'll need 150 ICs - it's probably doable with less than 50 and if he has 74LS series which are about 2mW per gate I would think 3A@5V will be generous.Even with 74 series (about 10mW per gate) I don't think he'll get up to 30A.Out of interest why simulate the program memory with a micro - much more fun to toggle in the programs from the front panel

author: codeboy2k
author_rank: Super Contributor
timestamp: March 31, 2013, 03:33:28 pm
content: good luck. Trying something like this is always a fun learning experience.I think I have a bunch of 2114's here too if you need moreI don't have many, maybe 8 or 16 chips, but I have no use for them, and you can have them if you need more than you already have.

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 03:50:11 pm
content: Quote from: grumpydoc on March 31, 2013, 03:30:36 pmI might add some switch to get to manual input mode thereQuote from: codeboy2k on March 31, 2013, 03:33:28 pmI have just one to be honest (wait, three, i have two more socketed in another comp, but i want to keep 'em there), and i wanted to use it as the Data RAM only...But adding a program memory made of three or six 2114's might be kinda interesting...I don't know, i might PM you later when i finally get in the building stage...

author: SeanB
author_rank: Super Contributor
timestamp: March 31, 2013, 03:51:22 pm
content: 22mA is with zero clock. Run a clock of a couple of MHz and the power used goes up considerably. I worked on computers made from TTL ( as well as Cmos, Nmos, Pmos and some eproms that needed a substrate bias of -21V) and they did need 20A plus of power. One had 2 50A switching supplies in it, and this was needed as it had around 5000 TTL IC's in it. This was all in a box about the size of 3 bread loaves, it was basically almost solid ceramic with a little aluminium around the IC's ( all in cerdip packages, only a few in DIP scattered here and there) as frames.If you need I have a few 8255 chips, some uarts and such, that can be posted to Chile ( though it may take a while given the postal system) that I will have to dig up.

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 03:59:45 pm
content: Quote from: C on March 31, 2013, 03:25:57 pmIt's an awesome concept.I've used something like this in my Minecraft computers before (never fully finished any of em yet... but at least the basic stuff worked), mainly because it was quick and i didn't have to put a huge clocking delays there which would slow it down even more...But I don't think I'm going to use this this time.Thank you anywayQuote from: SeanB on March 31, 2013, 03:51:22 pmHoly sheet!20A power...Monstrous... This stuff must have fried everything around it...Oh, i have only one 8255A at the moment... But i was thinking about building a multi-CPU Z80 and 8080A based computer system, so these might come in handy!Btw, I'm not in Chile...

author: SeanB
author_rank: Super Contributor
timestamp: March 31, 2013, 04:07:55 pm
content: My bad, was thinking of wrong flag...... Eu is easier to post to, though the post office your end may look funny at you. You probably will have to pay some duty on the stuff though.

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 04:24:18 pm
content: Quote from: SeanB on March 31, 2013, 04:07:55 pmClose enoughThat duty should be okay i think... Probably less than the price of the new chips themselves, right?

author: C
author_rank: Super Contributor
timestamp: March 31, 2013, 04:45:34 pm
content: Two sidesSide One: You could build the circuit with very few IC's and let ____ micro do it.Side Two: By doing the whole thing with logic chips, in the future it can go in to a FPGA. and be very fast.Both are good ideas, If you think about it, Your building it, so you get to pick both. There are great examples of both that made it big time.One down side is your special instruction set. You could copy the instruction set of an existing processor and things in some ways could be easer. What you may not of thought of is that there is a not bad second side.An example might help here.The pascal P4 compiler's output is pcode which is very simple. The computer(your CPU) executes a very small interpreter that translates pcode on the fly to what your CPU understands. Think read a byte from memory and call a function. Instead of an interpreter some people built a translator to convert from pcode to cpu instructions. One small simple program could let you program your CPU in pascal.If you do not want pascal there was a "small C" compiler published in "Doctor Dobbs" in the past you could modify.If you want more you might tryhttp://en.wikipedia.org/wiki/Amsterdam_Compiler_KitC

author: grumpydoc
author_rank: Super Contributor
timestamp: March 31, 2013, 04:55:46 pm
content: QuoteWhen I started work as a Software Engineer in 1989 the company still had the power supply from the mainframe that they had decommissioned (not all that long before I started there). IIRC it was something like 200A@5V, I suspect ECL rather than TTL but they did pull quite a bit of juice. There again Intel peaked with 130W for a single CPU, go figure.But coming back to this project if we assume that your example of 100A for 5000 TTL packages is about right we get 1A for 50..... or so.

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 05:06:11 pm
content: Quote from: C on March 31, 2013, 04:45:34 pmYeah, that's true...I was actually thinking about smacking it into VHDL or just drop a schematic there and simulate it in some FPGA development IDE (because i don't have any FPGA devboard yet, I might get one for my birthday I hope), but I have to make the schematic first. I'm working on it now...Then I might use it as my very own soft-CPU or something... It might probably even fit into some CPLD i guess...I haven't actually think about the compilers... I'd better program it into the machine code (like a boss), because it's a 4bit computer and i just can't be assed making some high-level compiler.I also have some other concepts of various CPU somewhere, some are actually quite interesting, they have multiple 'command cores' and shared multiple 'arithmetic cores' between them... And I have also some 8bit concepts, but I haven't punched em into the simulations yet...Quote from: grumpydoc on March 31, 2013, 04:55:46 pmGeez!How the hell big was it?200A...Our whole school takes 200A!And yeah, the 130W CPU's are kinda annoying... My old 486 machine had a 120W PSU for a whole machine i think or even less!

author: marshallh
author_rank: Unknown
timestamp: March 31, 2013, 05:25:07 pm
content: kevtris' said his NAND gate computer only draws about 300mA when I asked, then again hes not using original 7400 parts either.http://blog.kevtris.org/?p=62

author: grumpydoc
author_rank: Super Contributor
timestamp: March 31, 2013, 06:05:03 pm
content: QuoteNote I said 200A on the5Vrail - that's only 1kW so it will easily run on a normal mains outlet. I'm guessing your whole school needs a bit more than 1kW.It was a VAX of some flavour.Edit: Don't forget you can get 1kW power supplies for modern PCs and you'll need it for a top end multi-GPU rig.

author: C
author_rank: Super Contributor
timestamp: March 31, 2013, 06:07:09 pm
content: History;In 1977 or so, I worked at a research site. I was one of a very few allowed to touch a development system. As the system owners said, "we know if you break it you can fix it!" One 19' rack, a 300 line per minute printer and a 60 cps console/printer. Storage: two 1.2 mb removable hard disks, two data cassettes in the rack. The rest of the rack was all computer. If memory serves about 70 amps AC with a lot of high amp 5 volt supplies.. It was the owners cheap on-site software development system ($120,000+ in 1977), the bigger software problems they took back to the bigger system off site.in a different system back then, I had to replace a 32kb memory unit($80,000)Things have changed a little.--------The intel 4004 a 4 bit got improved two ways, the 4040 and the 8-bit 8008. The 4040's ideas to the 8008 -> 8080 and the 8080 to 16-bit to 32-bit to 64-bit4-bit is not a bad start if you use intel as an example.------If you are thinking of a Z80 cpu, the one thing they never did was give it the multitasking capabilities like you find in a 68010. What could a multi-tasking 8-bit cpu do. By building the CPU, you could research it.-----I worked with one/two? systems where the "UNIBUS" of the two pdp-11 was connected. Part of the time they were checking each other, the rest of the time were two separate computers.any way, have fun because the more fun you have, the more you play. The nasty thought is you might end up going to work to play, what a nasty thought.C

author: grumpydoc
author_rank: Super Contributor
timestamp: March 31, 2013, 06:20:23 pm
content: QuoteThere was nothing inherently stopping the Z80 multi-tasking - there was even a "port" of Unix (called UZI) as well as a couple of other multi-tasking operating systems such as MP/M.I even built a Z80 system with the address bus expanded to 20 bits by running the top four bits through a pair of 74LS189's - I think I had 512k bytes in it, sadly I never really wrote any software to fully take advantage.

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 07:29:59 pm
content: About the school, I meant 200A from 230V mains... that's 46 kW...I don't think I'm going to add any special features like multitasking for now, but i might add them later when it's done and the basic system works...I've got a crazy idea about how to actually do the multitasking... I don't know, maybe it's the standard way to do that, I haven't really thought about adding it before...So, somewhere in the adress space, there could be some kind of 'process adress' table.Somewhere else in the adress space would be the 'process' itself - the program.Each program would have special reserved space, where would be saved all the register contents it last used.The CPU will always look up the table, get the register set and execute one instruction of the process, rewrite the adress in the table and push the register set to the memory and then switch to another adress of the table.Hm... It's kinda limited though, because the adress space isn't much big and it would also require a lot of time I guess to process everything... Ofcourse there would be also some 'placeholder' or skipped adress which would be ignored (probably the highest possible adress), so it would skip it before executing it...But when I'm thinking about it... It should work, but there's probably a simpler way... But wiring it into the CPU itself might add some more spirit to it, that's true...--Richard (sent from my tablet)

author: C
author_rank: Super Contributor
timestamp: March 31, 2013, 07:38:01 pm
content: QuoteVery true, I worked with a TurboDos operating system, it made use of your extra memory easer to use.Lets see if I can say this in such a way go get across what I mean.The Z80 starts from hardware reset from address 0.The hardware interrupts cause cause what you might say is an immediate call to a subprogram.There is only one stack pointer register.And there are the RST__ instructions.----If you are trying to process real time interrupts, in stead of quickly processing the interrupt and getting back, you had to protect the interrupt process from what was executing at the time. The stack pointer was often used in programs with very little space available on the stack. So a good Interrupt program's first job became protect original SP and shift to a new stack with known size and shift back to original SP as last step of interrupt program. Add to this that all memory was writable, and you end up trying to run interrupt programs modified by original program while walking on eggs. The best cure I ever heard of was a Master Z80 with slave Z80's.The 68010 with some simple memory management added could really pretend to be many 68010s. Said a different way the 68010 could multi-task 68010's. Virtual CPU's, what only became possible a few years ago on a PC was possible when the 68010 was released. A 68000 could get close but not perfect.So what is missing from the Z80?Two stack pointers, one like now an one for interrupts.The RST__ instructions becoming protected system mode instructions using system memory space such that the system can decide system RST__ or original RST___.The same for Instructions that change Interrupt enable, mode.. tall interrupts switching to system memory space.some memory for system mode that the current Z80 could not access.I may be missing something hereLook atQuoteThink a 68010 running many copies of a program pretending to be 68010s.the pretending 68010s pretending - - -It was a stackable systemC

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 07:40:07 pm
content: Anyway, sorry C, my bad about the PSU... I was in some no-brainer state...1kW PSU's are kinda often these days for the highend gaming computers...Yeah, I suck without a cup of coffee

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 07:45:16 pm
content: Interesting... I've heard that 68k CPU's were really awesome, but I've never had any to experiment with...But according to what you said, I see I'm pretty close with my quickly thought up concept of multitasking to the one in 68010...Wait, wasn't a 68010 mentioned in the art of elecronics book? I had only a quick look into it, so I'm not sure... 68010 was a 32bit CPU which was 8 bit externally with 20 bit adress bus, am I right?

author: C
author_rank: Super Contributor
timestamp: March 31, 2013, 08:18:19 pm
content: The 68000The first was a huge chip, a dual in-line package over 2 inches long.At the time I think they were worried about making the package even bigger.Inside it was a full 32 bit processor, due to the package they could only connect the lower 24 address bits.The data bus could switch between 16 bit and 8 bit for every memory access. You could have some rom's 8-bit and some 16-bit, same with ram and IO.The later 68008 just had a 8-bit data bus. If you were programming it, the only way to know was a speed test of memory.They created some special package versions for HP that added more of the missing address lines.You do not see many 68010's, but if you had a 68010 chip with same package as a 68000, you could swap them with no other changes. and from the programmer's side the difference normally did not show.The 68010 just made it a rock solid for any possible use 68000. No hacking of the firstprogram started on reset for example unless the programmer goofed. My virtual 68010 might not even know it was running on your virutal 68010 for example.the 68000 copied a lot from the PDP-11. The big change was separate address and data register sets. More made somethings easer, while the separate function made some things harder.in 1982 or so, I was using a desktop 68000 with all the ram I could stuff in the box(1.5mb). Read a lot of high dollar boards with the largest dram. The PC AT came out after I was using this machine only the AT's display was better, the rest much worst.C

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 08:34:26 pm
content: Ah. Awesome! Thanks for valuable info, C!

author: C
author_rank: Super Contributor
timestamp: March 31, 2013, 08:35:58 pm
content: History;the first MAC's used 68000. The difference between a MAC and the desktop i talk of above was Apple using software to do what is best in hardware. The differences between my desktop and a true mult-user, multi-tasker was mainly lack of memory management. Think, something that might support 32 users on character crt's was the hardware in that desktop machine less the memory management.C

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 08:50:09 pm
content: I think I will rebuild the instruction set and the whole concept of the CPU... As you've said, C, it might be nice to do the registers and ALU the PDP way, so I'll change the registers to be all GPR. Then I will use separate ALU (or maybe even more than one?)... There won't be even a flag register itself - you'll have to call a function to put the real flag register contents to any of the GPR's probably... And I'll probably use separate memory in the computer to store the register tables and so on for multitasking and so on as I described before...Really, thank you for your valuable help, C, you really appear to be a real pro in this field

author: C
author_rank: Super Contributor
timestamp: March 31, 2013, 09:55:21 pm
content: Lets look at your idea a bit.First lets forget about speed, get something working and there are ways to speed it up.You mentioned a pic.You could write a program for the pic to pretend to be a ___ bit processor. As what went in the the ___ got bigger you may need to add some IC's to get the __ bit with. This program could pretend to be any processor you ever heard of but for the speed.I do not want to call this microcode, but in some ways it act's like it.You could do a lot of logic and to keep it simple, do steps working through a control program in control roms to control things. The PDP-11 's control roms were 160 bits wide if memory serves. The PDP-11's had an option that added more control roms to add floating point math if memory serves. The program in the control roms is normally called microcode.You could have an option like the PDP-11/45 did to add some ram an additional to the control roms and end up with what they called a writable control store. A crazy capability when you think of it, Run a program on a computer and add special instructions to the existing instruction set, instructions that take advantage of the hardware to do something not possible before or faster.I heard that in the later generation PDP's the rom's they could get were too slow, so they did a copy control roms the control ram step. I heard of a version of this that would be like your pic doing the initialization of the control ram.------You could do a lot of logic and have logic dictate the steps instead of the control roms. Here if you goof you rework logic instead of updating some data in the control roms. Some micro's are built with this method.-----In the past I worked with what they called a bit-slice processor.QuoteIn simple terms, if you put 4 4-bit bit-slice processors together and you could have a 16 bit processor. I saw this once in a place you probably not expect, a printer.---I heard that the dec vax ( a 32-bit CPU) was first a program on a PDP-11.and I have seen in the bigger computers where they use a smaller computer to do the io. If you want to see this to the extreme, there was an article in popular science in the 1970;s I think. What that article did not say well could be,"Take two of the worlds most powerful computers systems and use them to do the IO of the CRAY-1". Not quite right, but close. What the article did good on was the fact that the CRAY-1 was the little thing in the corner.-----if you want neat processor the NS320xx is one.32 Bit address8 bit cpu with ___ registers.16 bit cpu with ___/2 registers.32 bit cpu with ___/4 registers.The difference in a PDP-11 instruction for 16 bit vs 8 bit was one bit, but still messy doing 8-bit to 16-bit stepsThe NS320xx Instruction set made it real easyadd that it was designed with the idea that the CPU would be one or more chips.--------anyway, just use none or more and have fun.C

author: TheCrazyRichard
author_rank: Contributor
timestamp: March 31, 2013, 10:44:58 pm
content: I have heard something about the bit slicing before, I think intel had a whole bunch of various chips for making your own CPU of, I think it was the 3000 series if I'm right...A printer full of these? Pretty niceI don't want to use any ready-made ALU or stuff like that actually, mainly because I have none of em and I don't have much money to spend on this... I will naybe check some datasheets for inspiration later and do it myself...And I wanted to use the PIC as some preloader, not a simulator, when the CPU itself would be held in reset until the program is loaded into the program memory.I'll maybe use one more micro, AVR probably this time coz I have some of em atm, to generate video signals, so I could also do some simple graphics with the computer aswell...But to achieve that, 4bit data width isn't really much. I'm thinking about adding a feature to the CPU that would make it able to handle register pairs easily and even make the ALU compatible with 8bit stuff. Maybe not fully, that wolud depend on the current status of my wallet and junk boxI could also add some 555-based sound generator, maybe even 4 or 16 channel 4 bit square sound for funNo computer is complete without an annoying beeper!Okay, I'm gonna sleep now, it's 00:45 here (UTC+1).--Richard

author: C
author_rank: Super Contributor
timestamp: March 31, 2013, 11:03:27 pm
content: cobwebs hereIn the first PDP-11's, I think they used two 8 bit registers to get the width.So 8 visible registers, 16 chips.I do not remember if they used all 8 addresses in the hidden registers I told you of.Lets count from 00. Statis register was one of the hidden registers1. Unibus address (the address buss)2. Unibus Data out ( data buss to memory/io )3? I can not remember if they used #2 for Unibus Data IN ( data bus from memory/io ) they could have or it could have been seperate.4. Interrupt vector address. The PDP-11 let you have many of the same type of IO each at a different address for it's data registers When the IO generated an interrupt, it supplied an address to its Processing. One IO device could have many interrupts, each with it own address.5. Interrupt Level; There was a concept of priority. If I remember 7 levels, so a device like a hard disk could interrupt a slow thing like a serial port. more than one could have the same level and I think lowest address won.Front panel: When in stop mode, front panel with all the lights and switches basically controlled the unibus directly. You could see the contents of any IO register, memory and even the CPU registers. From the front panel CPU registers were a normal unibus address. So you could using just the front panel read and write anything. Some of the computers I worked with, you had to finger bone in the boot strap program, others had a boot strap program in rom.Front panel: When in run mode, The data switches could be read at a specific address. Some boot strap programs used this to find out what device to boot from. Some programs even used this. Most PDP-11's the lights were connected directly to what they were to monitor, but on some machines the program could write to the lights.Remember that wide control word.This is memory here so numbers could be wrong but Idea good.The 74181 has two sets of 4-bits for input and one set of 4 bits for output. If memory serves 4 bits to select what operation you want and some additional status bits out.For speed they did as much as possible at ounce.4 bits from control rom went to a 16 to 1 data selector to get data for 74181 input A4 bits from control rom went to a 16 to 1 data selector to get data for 74181 input B4 bits from control rom went to 74181 for function selection.4 bits from control rom went to a 1 to 16 data distributor to route 74181's outputYou now have two register values at the 74181's input, a function selected and waiting on the slow 74S181 output to get to the output of the distributor.a clock pulse an register is updated.the same clock pulse could update status register.Each instruction was just a bunch of simple steps happening in parallel.More in a secC

author: C
author_rank: Super Contributor
timestamp: April 01, 2013, 12:02:37 am
content: Now to cheat a bit and make it easer and more powerful.What the PDP guys really wanted to use fell in to two categories. Too ____ Slow or Not available.You can replace those separate register's with two port ram.You can replace those separate register's with two steps.so you can do like some RISC machines and use fast ram with two steps and two latches.feed the two latches to the ALU and put it back in ram. If you need a copy of something like for something like the address buss just make a copy as you update the ram. Lots of general purpose registers.Want to cheat more, the pic reads and writes the ram and does the ALU function. Still works, just a lot slower.Need a reference to work from so lets use a Z80 to startAddress busData bussControl bussAddress validwrite/readWaitInterruptThe Z80 bus works one way, the 6800 is a little different. If you look at a lot of chips they work with one or the other or both.You said 4-bits so adjust the widths.You want the register's outside the PIC, use a ram chip, Inside use some pic ram.IBM cheats big time here, They design a nice big instruction set. If you have a lot of cash your 64-bit computer has a 64-bit processor. Not so much cash, a 32-bit processor pretending 64-bit. I would not be surprised it they have a 16-bit pretending to be 64--bit.They even cheat on ram using virtual memory pretending to be Ram in the above.All kinds of ways to cheat, the big guys do it all the time ( "The Cloud") the big pretender. If you do it right, you could have a program on a pc pretending to be the parts missing from a pic pretending to be a (Z80, PDP-11, Arm)If it's too slow, use a faster processor, faster hardware or go parallel. The PDP-11/34 used one set of 74181's, I think the PDP-11/70 used two sets to gain a little speed So go crazy, just keep it logical.C

author: C
author_rank: Super Contributor
timestamp: April 01, 2013, 12:26:13 am
content: You said you got 150 chipslook you might be surprised at what you find, a 74181 was not uncommon.You said video, you might want to look at a 6845 or the same from intel.You might do a separate video chip pretender, Use the chip or chips to give you ideas/hints on what's needed and how they did itI would strongly hint not to try to put too much in one basket so to speak.You might want to think 4-bit cpu project and a separate video chip pretender, and have the two talk.Have funC

author: TheCrazyRichard
author_rank: Contributor
timestamp: April 01, 2013, 10:30:53 am
content: Umm, I've got 150 TESLA (good old czechoslovak manufacturer of electronics) 7400's only.I have lots of others around as well, but I don't have any 74181, but I might ask my friend to check if he has one...I've did a quick search on ebay and i found some, but... yeah, I don't know...They have some in farnell i see... but they're quite expensive...It might speed up the design and also the operation though, so I will consider buying it...Or maybe, do you have any? I think one should be enough, because then i could 'virtually cascade' it or somethingOfcourse if you have two of them, it would be even more awesome.--Richard

author: TheCrazyRichard
author_rank: Contributor
timestamp: April 01, 2013, 01:14:28 pm
content: I've completely redesigned (not only) the instruction set now.Go check the main post!The computer will be probably much slower too, but also much better I think, because programming a '24bit memory' is easy, it's just three generic 8 bit memories and I could just get tons of them

author: C
author_rank: Super Contributor
timestamp: April 01, 2013, 03:54:31 pm
content: Richard,Are you hearing an echo like Richard,, Richard,Getting the C. C, here, Think from my long dead Gran.You know the "when you have done something wrong line" from a lady.I left out a register in all our chat!Not just any register, could be "THE REGISTER"Give you a hint,You read it from memory more than any thing else.The "Instruction Decode Register"74181's none here,there are newer numbers, But the reason they were used so much was that It made sense and a minor little thing of saving the space of a lot of separate chips. Some data sheets even list all the parts.So no 74181, "Build It".Me, I might look at it and say ROM __ x 8Just got up, thought above imporantant.C

author: TheCrazyRichard
author_rank: Contributor
timestamp: April 01, 2013, 04:57:20 pm
content: I will actually latch the output from the memory with some 74LS gate, because the memory is CMOS. So i think that's actually in thereI know the jump instructions will completely fock the whole execution up if there was no latching, because I've actually done some tests of some of my CPU ideas in Minecraft.But I think I'm gonna rework the instruction set again, because it's kinda too much complex, so I think I'll return to my original idea of the CPU with a single program and fixed registers for the ALU, because it's probably easier to make and it would be maybe a bit faster.I'll probably use 16 bit program width, because it's easier to get and program the 16bit memories these days...I think I'll make a new notebook for this and try to draw some schematics at school tomorrow, because it's really boring in thereRichard

author: C
author_rank: Super Contributor
timestamp: April 01, 2013, 05:04:12 pm
content: Here Is a BIG ThingToday almost everyone writes in hex or bits. For a lot of documentation they do not even make a nice all in one place list.When you look at some old computers and other parts, You need to use their language not a translation that looses some information.You thinking "What the _____"Binary is Binary and hex is a simple way to write binary, so how can something be lost in the translation.The PDP-11 was and octal machine!Look close at that Big huge front panel, They used lights for each bit but look closer and you see they grouped them in 3's not 4'sEvery thing was listed octal first, and when you take the PDP-11's instruction set and list it in octal it just makes sense.Bit 15 Word / byteBit 14 InstructionBit 13Bit 12Bit 10 ModeBit 9Bit 8Bit 7 RegisterBit 6Bit 5Bit 4 ModeBit 3Bit 2Bit 1 RegisterBit 0In Hex you do not see the pattern an may not see it in binary."The PDP-11 is a 16-bit machine with 8 general Register's."So looking at the above 2 operand instruction formatModes = 8Instructions = 4 with a choice of word or byte.But with 4 instructions they would use all the 16 bit combinations. So they saved "00" and just had 3 "2 operand instructions"If Bit 14 & Bit 13 = 0 then look at one operand instructions.One operand instructions Saved the "0000" for next subsetSomeone looking at that nice front panel could quickly tell what is what, They had a cheat card that listed every instruction. Very simple and nice.Now take a look at the Z80 instruction set in octalIf memory servers, All most makes sense in octal but had some specials as exceptions.It is hard to find, but the "ARM" instruction format has grouping, they just did not stick with 3 or 4 bit groupsSo for what it's worth, might keep above in mind.C

author: C
author_rank: Super Contributor
timestamp: April 01, 2013, 05:52:50 pm
content: Memory computerOne of the old computers I worked with pulled a fast one so to speak.No CPU registers.All Register were in memory.If you worked on it, you quickly found out the trick. They just moved some of the normal memory inside the CPU. From the address buss they used all the address bits. Inside the CPU they used chip select and some address bits.--------------------Fixed ______ space.Stacksome CPU's you might say use fixed stack space. Not having to read/write main memory for stack operations can save time. The problem is that someone will have a problem with a fixed stack size. The more general an consistent you can get, the better.------stuffingFrom what I have seen, when you stuff a lot of different things in a Register it comes back and bites you big time. Better in long run to do a better job and not cram/stuff things.Examples:IBM stuffed things for the hard disk controller in the PC XT, They combined parts of two different Registers in a third Register such that they saved a few bits from the original two Registers and ended up with three shorter Registers. They saved a few bits at the cost of slower software and future Hard disk size increase.68000 remember 32-bit address inside, chip limit to 24-bit outside. Some programmers thought "There is a byte wasted in every address" . They did their thing and it worked,---- until the 32-bit outside parts arrived.C

author: TheCrazyRichard
author_rank: Contributor
timestamp: June 16, 2013, 05:03:51 pm
content: I've completely rebuilt the instruction set now, and also the whole architecture. From now,it's not 4bit anymore.It's gonna be an 8bit computer! WOOHOO!Since our success with an xRisc 3L - based 8bit computer we made in Minecraft, my friend joined me at building this computer.This computer doesn't include a stack actually, but it can be implemented by software actually! () It's completely mad, but it might work.It doesn't include interrupts either. What a piece of garbage, eh?But it has some 'WAIT' instruction, which just sorta halts the CPU until it receives a signal there. Good for syncing stuff together i think.Also, we're probably going to use 74LS logic ONLY. Why? Coz LS's fast! Okay, I know if i used HCT or HC instead, it would be cheaper, won't consumpt an arm and a leg, and it would be about the same speed. But well, for a classic old-school feel you need oldschool gates! And that's why i don't wanna use any CMOS garbage there. ()RAM and IO space is gonna be shared on the same data and adress bus. This might actually make making the bootloaders quite easy i guess!One of the targets I haven't mentioned yet, is to make the computer 'stackable'. By that i mean 'stacking' the registers and ALU up, while still using a single instruction decoder. Why? Why not! You could easily make a 16bit CPU out of two 8bit ones! And so on.So what do you think about this? How much 'garbageous' is it actually?Richard, the crazy one.