0% found this document useful (0 votes)
35 views15 pages

Elec2630 Embedded Systems Theory

The document discusses the operation of a microcontroller in 4 stages: 1) Fetch - The program counter outputs the instruction address from program memory. 2) Decode - The instruction is decoded into control information and data. 3) Execute - The instruction is executed using the ALU. 4) Next - The program counter is updated to the next instruction address. The stages are controlled by a clock signal and proceed sequentially from one stage to the next.

Uploaded by

openid_ZufDFRTu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views15 pages

Elec2630 Embedded Systems Theory

The document discusses the operation of a microcontroller in 4 stages: 1) Fetch - The program counter outputs the instruction address from program memory. 2) Decode - The instruction is decoded into control information and data. 3) Execute - The instruction is executed using the ALU. 4) Next - The program counter is updated to the next instruction address. The stages are controlled by a clock signal and proceed sequentially from one stage to the next.

Uploaded by

openid_ZufDFRTu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 15

ELEC2630 EMBEDDED

SYSTEMS THEORY
Lecture 4: Microcomputer
Fundamentals
Microcontroller Operation
• Micro-controller operation is controlled by
a clock signal
• The operation proceeds in a number of
steps with the move from the present step
to the next triggered by the clock
• The stages are often labelled as follows:-
Fetch Decode Execute Next
Stage 1 Fetch
• The program counter output is the address
of the instruction to be executed

• This address is applied to the program


memory (ROM) and the output of the
ROM is the instruction to be executed and
is usually latched in an instruction register
Stage 2 Decode
• This stage decodes the instruction into
control information and any additional data
• The bit pattern of the control information
sets up the data paths needed for the
instruction
Stage 3 Execute
• The instruction is executed here which
usually involves the ALU, the Arithmetic
and Logic Unit
Stage 4 Next
• This stage generates the address for the
next instruction to be fetched by
manipulating the program counter

• In most cases the program counter is


incremented by one

• For some instructions a new address is


loaded into the program counter
Instruction Formats
Examples of Instructions (1)
Examples of Instructions (2)
Memory Contents
Machine Code
Assembler code for this task
'C' code for this task
Usage Summary
• Machine code is the lowest level of
program in a computer being the binary
pattern of the instruction
• Assembler code has a one-to-one
relationship with machine code but is more
intelligible to Humans
• 'C' code is the highest of the three levels
and the final machine code depends on the
skill of the compiler writer in assembler
coding

You might also like