• 3,722 views, 2 today
  • 272 downloads, 1 today
  • 5
  • 4
  • 2
Zedh74's Avatar Zedh74
Level 28 : Expert Miner
47
Project : 4-bit computer (en français ci-dessous)
In fact, it's a simple 4-bit processor, made as a support for french youtube videos (youtuve videos / warning : french video) to understand how a computer works. And fun to make it work in Minecraft !
Built and tested in 1.6.2.

It's components :
- a very very very slow clock, humm 0.105 Hz (to see what's happen !!!) (gray wool)
- a main memory : 16 bytes of 4 bits (64 bits) (white wool)
- a micromemory : 17 words of 15 bits (ROM) for the microcode (light gray wool)
- a 4 bits data bus (yellow wool)
- a 4 bits address bus (orange wool)
- an 4 bits ALU (addition, substraction, and, or, not, shift) with an entry register, R0, and an output accumulator registry, R1. (cyan wool)
- a program counter for main program and micro program counter for micromemory (light blue wool)
- a 4 bits address register (pink wool)
- an instruction decoder (lime wool)
- a complet set of microinstruction (red wool)
- automatic stop in end of memory

It's intruction set (machine code (hexa) : opcode mnemonic [+ operand] = description) :
- 0 : NOP = no operation
- 1 : LDI value = immediate load of a value in R0
- 2 : LDM addr = load of a memory value (address) in R0
- 3 : STM addr = store in the memory (address) from R1
- 4 : COPY = copy R0 in R1
- 5 : SHL = left shift of R1
- 6 : SHR = right shift of R1
- 7 : ADD = Addition, set R1 + R0 in R1
- 8 : SUB = Substraction, set R1 - R0 in R1
- 9 : AND = Logic And between R0 and R1, the result is put in R1
- A : OR = Logic Or between R0 and R1, the result is put in R1
- B : NOT = Logic Not of R1 put in R1
- C : JMP addr = Jump to the indicate address (set the address in the program counter)

The main memory contain this program :
0 : C 3

Jmp @start; PC <- 3
2 : D  
a:Data 13; define variable a
3 : 2 2start:Ldm @a; R0 <- memory[2]
5 : 4
Copy; R1 <- R0
6 : 1 2
Ldi 2; R0 <- 2
8 : 8loop:Sub; R1 <- R1 - R0
9 : 3 2
Stm @a; memory[2] <- R1
B : C 8
Jmp @loop; PC <- 8


-------------------------------------------------------------------------------------------
Projet : Ordinateur 4 bits
C'est en fait un processeur 4 bits simple, fabriqué comme support pour des vidéos youtube (playlist des vidéos youtube) afin de comprendre comment fonctionne un ordinateur et s'amuser à le faire fonctionner dans Minecraft.
Fabriqué et testé en 1.6.2.

L'exemple d'architecture pour l'ordinateur choisi ici est tiré du bouquin : Architecture de l'ordinateur, de Irène Durand et Robert Strandh.

Ses composants :
- une horloge très très lente, hum 0,105 Hz (pour voir ce qui arrive !) (laine grise)
- une mémoire principale de 16 mots de 4 bits chacun (64 bits en tout) (laine blanche)
- une micro-mémoire de 17 mots de 15 bits (mémoire morte) pour le micro-code (laine gris clair)
- un bus de données 4 bits (laine jaune)
- un bus d'adresse de 4 bits (laine orange)
- une UAL 4 bits (addition, soustraction, et, ou, non, décalages) avec un registre d'entrée, R0, et un registre accumulateur de sortie, R1. (laine cyan)
- un compteur ordinal pour le programme principal et un micro compteur ordinal pour la micro-mémoire (laine bleu ciel)
- un registre d'adresse 4 bits (laine rose)
- un décodeur d'instructions (laine vert clair)
- un jeu complet de micro-opérations pour gérer le séquencement (laine rouge)
- arrêt automatique arrivé en fin de mémoire

Son jeu d'instruction (code en hexa : mnémonique [+ opérande] = description) :
- 0 : NOP = non opération
- 1 : CHGI valeur = chargement immédiat d'une valeur dans R0
- 2 : CHGM adr = chargement d'une valeur de la mémoire (adresse) dans R0
- 3 : STM adr = stockage en mémoire de la valeur de R1
- 4 : COPIE = copie de R0 dans R1
- 5 : DECG = décalage gauche de R1
- 6 : DECD = décalage droit de R1
- 7 : ADD = Addition, mise de R1 + R0 dans R1
- 8 : SOUS = Soustraction, mise de R1 - R0 dans R1
- 9 : ET = Et logique entre R0 et R1 avec résultat dans R1
- A : OU = Ou logique entre R0 et R1 avec résultat dans R1
- B : NON = Non logique de R1 avec résultat dans R1
- C : SAUT adr = Aller à l'adresse indiquée (mise de l'adresse dans le compteur ordinal)

La mémoire principale contient ce programme :
0 : C 3

Saut @début; CO <- 3
2 : D  
a:Donnée 13; Définition de la variable a
3 : 2 2début:Chgm @a; R0 <- mémoire[2]
5 : 4
Copie; R1 <- R0
6 : 1 2
Chgi 2; R0 <- 2
8 : 8boucle:Sous; R1 <- R1 - R0
9 : 3 2
Stm @a; mémoire[2] <- R1
B : C 8
Saut @boucle; CO <- 8
Progress100% complete
Tags

Create an account or sign in to comment.

1
06/03/2019 2:37 pm
Level 18 : Journeyman Architect
Glooobp
Glooobp's Avatar
Ah ..............
1
04/02/2014 5:14 am
Level 17 : Journeyman Crafter
Coolboy100
Coolboy100's Avatar
wowowwow
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome