Hello everyone I want understand how does microcontroller work so I have done some homework
Instruction should be fetch, decode and execute
assembly code
Mov A, #2
Mov R1, #3
Add A, R1
lets say program convert into hexa code
8000 0101 1st Instruction
8001 1o01 2nd instruction
8002 0101 3rd Instruction
this hex code stored into rom memory
address data
8000 0101
8001 1o01
8002 0101
location of data stored into RAM
location
8000
8001
8002
ok now we want to fetch 1st instruction
we now about accumulator register , decoder
Instruction 1st is 8000 0101 fetch from rom memory, decoder take the information and it will store the value in A register, processor send the request in Ram memory and it look location 8000 for data 0101
program counter execute instruction one by one
now 2nd instruction 8001 1001 fetch from rom memory decoder take instruction and it will store value into register R1 processor send request in ram memory and ram memory look location 8001 for data 1001
3rd instruction fetch from rom memory decoder decode instruction and tell the alu for addition
alu do addition and result will save in ram memory
In my above paragraph I think there are many wrong statement so please check out me and correct me