![]() | ![]() | ![]() |
| | |||||||
| Electronic Theory Basic principles, ideas, concepts, laws, and formulas behind electronics. |
| | Thread Tools | Search this Thread | Display Modes |
| | ||
| Experienced Member | Quote:
Most all fetch their instructions from a ROM/RAM, that is a common feature of any general purpose processor. In reality the processor doesn't know or care what kind of memory is being used when it fetches an instruction, It just places an address onto it's address buss and expects to receive the instructions back on it's data buss, so where the instructions are contained is just a implementation detail for a specific processor. Lefty | |
| | |
| | ||
| Experienced Member | Quote:
So, in effect, I could take a Parallel EEPROM like this: Datasheet , write the instructions to it in the CPU's set (assuming it's 8-bit also, since the ROM is 8-bits wide) and it'd start executing instructions? | |
| | |
| | |
| Experienced Member | hi, So, in effect, I could take a Parallel EEPROM like this: Datasheet , write the instructions to it in the CPU's set (assuming it's 8-bit also, since the ROM is 8-bits wide) and it'd start executing instructions? Im afraid not. The memory only holds the programmed instructions, it dosnt execute them. The instructions are executed by the CPU. A simple comparision would be if say someone gave you [the CPU], a list [the program instructions] of things to do. You would be the one [CPU] executing the instructions on the list. Is this clearer? Eric Last edited by ericgibbs : 21st March 2007 at 05:46 PM. |
| | |
| | ||
| Experienced Member | Quote:
You...missed the rest of the conversation? | |
| | |
| | ||
| Moderator | Quote:
Yes, if you mean the CPU starts executing the instructions. Not sure about the specific device you mentioned. There is a timing issue, put simply the memory needs to have a speed compatible with the processor. I am curious regarding why you are asking this. You can buy micocontrollers with enough built in flash to do most jobs. Maybe if you let us know where you are going with this we can save a few posts and jump to the end. Are you interested in knowing how a PC boots ? Or is this confined to microcontrollers ? | |
| | |
| | |
| Experienced Member | When the processor is powered up, or reset, the program counter (address register which contains the bits of the binary address of the next-to-be-fetched-and-executed instruction) to some predetermined value. On the first clock cycle following the reset procedure, this address will then be the starting point of the program to be executed on power up or reset. For some processors this starting address is 0. For others it is different. For yet others, the power-up reset is a little more complex - the processor can fetch the address of first instruction of the program to execute from a predetermined ROM location and store that in the program counter, and then start execution. This enables the programmer to put the start-up program anywhere in ROM, as long as he stores the binary address of that program's first instruction in the ROM location where the processor expects to find it. This location is called a vector. Processors use vectors like this to respond to different events, such as power-up, interrupt or reset. Typically the processor expects to find the start addresses of the different program modules in a block of ROM at a fixed, known address. For a power-up the processor might retrieve the address from the first element in this 'vector table' and start execution from that address. For a reset, it might fetch the address from the second element, and so on. From a practical standpoint, all programs that are to be executed at power-up or reset are stored in ROM or some type of non-volatile directly addressable memory - NOT a hard disk or other form of backing store. Depending on the processor, it will either fetch an address from the vector table part of that ROM and execute from there, or start executing from an already known and fixed address in that ROM. Either way, it's all in ROM. If the system is to run an operating system (or anything else, really) stored on some backing storage device, such as a USB stick or hard disk drive, it will be the job of the ROM program to copy that external program into RAM, and branch into the first (entry) instruction of that program. Just for completeness (forgive me if this is superfluous or obvious), the ROM also often contains support subroutines that other programs can call to control and access the various hardware devices connected to the processor. These routines form a large part of the BIOS of PCs. The BIOS is a program in ROM that executes upon start-up and reset, which tests the system, loads the OS into RAM, subsequently relinquishing execution to the instructions of that OS, and provides support functions to the OS for hardware control and access. |
| | |
| | ||
| Experienced Member | Quote:
Sorry about not really giving any of my intentions. I hope to learn enough to be able to build a simple, old single-board computer, much like the Spectrum Z81 (But without the high price tag and limited availability). I would use microcontrollers, but that really ruins the fun for me, and I'm really into the fun of experimentation. | |
| | |
| | |
| Experienced Member | A primer on Z80 assembly: http://users.hszk.bme.hu/~pg429/z80guide/ After reading that, you may want to tackle building some hardware: http://www.z80.info/homebrew.htm Then again, maybe not.....
__________________ --- The days of the digital watch are numbered. --- |
| | |
| | ||
| Moderator | Quote:
Not a problem. I am an old Z80 fan. At one time a friend and I built a SBC Z80 that ran forth. It used 2 SCC chips (4 serial channels), other then that most 16F pics would run rings around it. | |
| | |
| | ||
| Super Moderator | Quote:
For some purposes (probably most?), but the Z80 (or any other micro-processor) has the advantage of much more RAM (or at least you can connect much more RAM). | |
| | |