108 Flashcards
What is a microcontroller? (5)
> Computer on a single chip
Used in embedded systems
Contains the CPU, Memory and peripherals
Software is programmed on a separate computer and then compiled into a list of instructions which are copied to the microcontroller. This is called firmware
Microcontrollers execute instructions
What are the different types of microcontroller architecture? (4)
> Instruction set architecture
Microarchitecture
System architecture
Load store architecture
What is ISA?
> Instruction Set Archetecture
> Instructions that the microcontroller can execute
What is microarchitecture?
This is the way that the ISA is implemented
What is system architecture?
The overall design of the system
What is load store architecture?
The way that data is moved around the system
What is a CPU?
This executes the data
What is memory?
This stores data and instructions
What are the different parts of a CPU?
> Program counter > Incrementor > Memory address register > Memory buffer register > Instruction register > Control unit
What is the program counter?
Contains the address of the next instruction to be counted
What is the incrementor?
Increases the value stored in the Program counter
What is the memory address register?
Stores the address of the memory being used
What is the memory buffer register?
Stores data that has just been read from memory or data that is to be written
What is the instruction register?
Stores the instruction that currently being executed
What does the control unit do?
Controls the CPU
What is the architecture of memory?
> Byte organised
Each location in memory can store an individual byte
Each location has a unique binary address
How is data stored in memory?
> Stored in words of size 32 bits (4 bytes)
> Words must be stored in an address that is a multiple of 4 for best packing
What are the 2 memory types and what is the difference?
> Flash - Stores instructions and is non-volitile
> RAM - Stores data and is volitile
What is the instruction execution cycle?
The computer will fetch an instruction and execute it in 3 steps:
> Fetch
> Decode
> Execute
What happens during the fetch part of the instruction execution cycle?
> The program counter (PC) increases and outputs the binary value to the Memory address register (MAR)
The MAR points to the location in memory given to it by the program counter
The memory is read and the instruction stored within is copied to the Memory buffer register (MBR)
The content of the MBR is copied to the Instruction register
The value in the PC is incremented
What happens during the decode part of the instruction execution cycle?
> The instruction register (IR) is decoded
Types of instructions
• Data processing
• Loading data
• Storing data
The control unit will determine the kind of instruction that is stored in the IR and how to proceed
What is an example of a load-store architecture?
> A Microcontroller is an example of a LOAD-Store architecture
• Only data stored in registers can be operated
on
• Data In main memory cannot be operated on
What happens during the execution part of the instruction execution cycle?
> Executes the instruction decoded by the control unit
What are some of the different types of instructions and how they are executed? (3)
> Load instructions
• Loads data from memory and writes it to a
register in the register bank
• The address of the memory location to read
from may be stored in another register
Data processing instruction
• The ALU will carry out the operation
• The result of the operation is put back into a
register
Store instruction
• Moves data from the register bank to the main
memory