This basic computer is built from these components:
| Component | Bits | Functionality |
| DR | 16 | Data Register |
| AR | 12 | Address Register |
| AC | 16 | Accumulator |
| IR | 16 | Instruction Register |
| PC | 12 | Program Counter |
| TR | 16 | Temporary Register |
| INPR | 8 | Input Register |
| OUTR | 8 | Output Register |
| MEMORY | 16 | Memory 4096 x 16 |
| FGI | 1 | Input Flag |
| FGO | 1 | Output Flag |
| IEN | 1 | Interrupt Enabled Status |
| R | 1 | Interruption Status |
| I | 1 | Decode Bit |
| S | 1 | Halt Status |
| E | 1 | Carry Bit |
| SC | 3 | Sequence Counter |
And the table of instructions it supports is:
| Symbol | Hexcode | Description | ||
| I = 0 | I = 1 | |||
| M E M O R Y | AND | 0xxx | 8xxx | AND memory word to AC |
| ADD | 1xxx | 9xxx | Add memory word to AC | |
| LDA | 2xxx | Axxx | Load AC from memory | |
| STA | 3xxx | Bxxx | Store content of AC into memory | |
| BUN | 4xxx | Cxxx | Branch unconditionally | |
| BSA | 5xxx | Dxxx | Branch and save return address | |
| ISZ | 6xxx | Exxx | Increment and skip if zero | |
| R E G I S T E R | CLA | 7800 | Clear AC | |
| CLE | 7400 | Clear E | ||
| CMA | 7200 | Complement AC | ||
| CME | 7100 | Complement E | ||
| CIR | 7080 | Circulate right AC and E | ||
| CIL | 7040 | Circulate left AC and E | ||
| INC | 7020 | Increment AC | ||
| SPA | 7010 | Skip next instruction if AC is positive | ||
| SNA | 7008 | Skip next instruction if AC is negative | ||
| SZA | 7004 | Skip next instruction if AC is zero | ||
| SZE | 7002 | Skip next instruction if E is zero | ||
| HLT | 7001 | Halt computer | ||
| I/O | INP | F800 | Input character to AC | |
| OUT | F400 | Output character from AC | ||
| SKI | F200 | Skip on input flag | ||
| SKO | F100 | Skip on output flag | ||
| ION | F080 | Interrupt on | ||
| IOF | F040 | Interrupt off | ||
The assembler is a bit different than the book, it supports labels of any size and uses the character (:) instead of (,) also I added the LBL pseudo instruction that can help in some cases:
| ORG | N | Hexadecimal number N is the memory location |
| for the instruction or operand listed in the following line | ||
| DEC | N | Signed decimal number N to be converted to the binary |
| HEX | N | Hexadecimal number N to be converted to the binary |
| LBL | L | Address of label L to be converted to the binary |
| END | End of symbolic program |
There are 3 sample programs to select, or you can enter your own. After your program is ready press the [Assemble] button, if the program is correct you will need to load the binary codes of the program into memory, you can do this pressing the [Load] button. Now you are ready to run the whole program with [Run] or just go cycle by cycle with [Next].
The source is available under the MIT license in:
http://code.google.com/p/basic-computer-simulator/
Have fun!
A programmable, mechanical, digital machine
ReplyDeleteCould carryout any calculation
Could make decisions based upon the results of the previous calculation
Components: input; memory; processor; output
http://camnetway.blogspot.com
Hola.
ReplyDeleteAntes de nada, perdona que te escriba esto como un comentario, pero es que no vi tu email en el tu blog
Soy el webmaster de publizida.es
Publizida BLOG'S es un ranking / directorio de clasificación de blogs en español, creado con el único propósito de dar a conocer los mejores blog's
Registrando su blog en Publizida BLOG'S accederás al servicio de estadísticas gratuitas y podrás participar en el TOP.RANKING
También puedes acceder a la valoración que los usuarios hacen de su página.
Y lo mas importante...
darte a conocer y aumentar el numero de visitantes a tu BLOG de manera totalmente gratuita.
Si te interesa puedes darte de alta
ALTA DIRECTORIO DE BLOGS
o visitanos en ......
DIRECTORIO DE BLOGS
HTTP://PUBLIZIDA.ES
Muchas Gracias por tu tiempo... y disculpa si no fue la mejor manera de darme a conocer.
Un saludo.
DAVID T.
Webmaster de Publizida.es