1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Fetching and executing instruction?

  1. Apr 3, 2014 #1
    Instruction should be fetch , decode and execute.
    ''Instruction fetch from memory''
    I have read this statement many times but don't know which memory ROM or RAM memory ?
  2. jcsd
  3. Apr 3, 2014 #2


    User Avatar
    Science Advisor

    The actual program instruction could be stored on ROM, RAM, FLASH or ten other types of internal or external memory. Depending on the processor and system architecture the instruction might have moved thru several times before actual CPU execution in the processor SRAM cache or internal SRAM memory registers.

    Take a look at a typical microcode processor instruction cycle: https://www.cs.umd.edu/class/fall2001/cmsc411/projects/DLX/proj.html
  4. Apr 7, 2014 #3
    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 in to rom memory
    address data
    8000 0101
    8001 1o01
    8002 0101

    location of data stored into RAM

    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
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted