0% found this document useful (0 votes)
27 views38 pages

SEBB3033-L02-UP System HW Fundamentals

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views38 pages

SEBB3033-L02-UP System HW Fundamentals

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Lecture 2

Microprocessor-System
Hardware Fundamentals

Arief Ruhullah Harris


Faculty of Biosciences and Medical Engineering
Structure of a Microcomputer

§ Microprocessor (µP): a digital circuit which reads and


execute a program stored in the memory.
§ µP is programmable: its operations are controlled by the
program
Structure of a Microcomputer
§ Program: a sequence of binary coded machine
instructions to be executed by the µP
§ Memory: Stores programs and data
§ Input/Output (I/O): Provide interfaces between µP and
outside world. Example: Parallel I/O, Serial I/O
§ Normally, µP is used in a general purpose
digital computer.
eg: Pentium µP is use in a PC for documents preparation,
graphics processing, playing multimedia files, computer
games, etc.
A Computer System
Stores and retrieves data Moves data between the computer
and its external environment

CPU Memory Input/Output

Controls the operation of the computer


Performs its data processing functions

Address bus Provides communication


among CPU, main memory and I/O
Data
Databus
bus

Control bus

An embedded system also has the same


structure but at a smaller size
4
What is Microprocessor ?
Central Processing Unit
(CPU): Control the operation
of the computer and
performs its data CPU
processing functions; often
simply referred to as
PROCESSOR
Processor (CPU): Control Unit (CU)
The Central Processing Unit (or µP)
To synchronize and control the overall operation of the µP system
To decode instruction and pass the necessary control signals to CU

Control Unit &


Instruction Decoder
To perform the arithmetic and logical operations within the CPU

Arithmetic/Logic Unit

A set of internal storage Registers


locations within the CPU
Processor or Central Processing Unit (CPU)
Menyimpan
maklumat Memproses

Daftar
n ALU
a
m
al
a
d Bas alamat
s
a
B
Bas data
Unit kawalan
Bas kawalan

Mengawal
• Control & Instruction Registers
– Program Counter (PC)
– Instruction Register (IR)
– Etc
• User-Visible Registers
– General Purpose Reg.
– Address Register
– Data Register
– Flag Register
Microprocessor – Basic concept
Address bus 16-bit / 32-bit / 64-bit wide

Data bus bidirectional


CPU 8-bit / 16-bit / 32-bit / 128-bit

Control bus Timing signals, ready signals,


interrupts etc

Microprocessor, by-itself, completely useless – must have external peripherals


to Interact with outside world
Microprocessor – Basic concept
Address

Control

Keyboard
Boot Screen
CPU ROM Instruction
Data Trans- UART
(program)
RAM ducers Parallel
Used at ROM
interface
startup
etc

Data

Microprocessor, by-itself, completely useless – must have external peripherals


to Interact with outside world
Data & Address Buses
1. Smallest transferable amount of
data from memory to CPU (and 24-bit address bus
vice versa) is one byte.
2. Each byte has a unique location or CPU Memory
address. 16-bit data bus
3. The address of each byte is
written in hexadecimal (hex). For Data bus 16 bits
AVR, the prefix ‘0x’ means a hex
value.
15 0
4. The range of addresses
0x000000
accessible by the processor is the
memory space. (Limited by the
Address bus 24 bits
size of the address bus).
5. The Atmega328 (and many other 224-1=

AVR models) does not have 8M locations


direct support for an external
memory interface.
0xFFFFFF
Memory

Memory Location-1
Memory Address-1 ®
Memory Address-2 ® Memory Location-2

1 2 3 4 5 6 7 8

1 byte = 8-bit data


1 word= 2 bytes
1 double = 2 word
Memory Address-n ® Memory Location-n

Number of addresses 2N (where N is an integer)


Memory Devices
● Read-Only Memory
– Non-volatile memory: contents is retained even without power
– In embedded systems, used to store application programs and test routines
– Contents can be set by fixing it during manufacturing or “burning” it using
a programming device
– Common types include MROM, PROM, EPROM and flash memory
– Erasable types can only be rewritten a fixed number of times
● Random Access Memory
– Contents lost without power (volatile memory)
– Used to store temporary data. In embedded system, very little RAM is
required. Some systems don’t even have RAM at all!
– No limit to number of writes the device can handle
– Fast writes (unlike EPROM/EEPROM)
– Two major types are SRAM and DRAM
Memory Devices: SRAM vs. DRAM
Features SRAM (Static RAM) DRAM (Dynamic RAM)
Data Holding Static - No need to be refreshed Dynamic - Requires the data to
as the transistors inside would be refreshed periodically
continue to hold the data as long (additional circuitry)
as the power supply is not cut off.

Read/Write Speed Faster (average: 10 ns) Slower (average: 60 ns)


Power Consumption Lower Higher
Interfacing Simpler More complicated
Transistor Count/bit Lot More (6 transistors) Less (1 transistor + 1 capacitor)
Capacity/Density Smaller 6 timer larger
Price Far More expensive Less expensive
(1GB SRAM cache ≈ (1GB DRAM cache ≈ $20-$75)
$5000)
Common Application Cache Memory (Speed is crucial) Main Memory (Capacity is crucial)

* Synchronous dynamic random access memory (SDRAM) is dynamic random access memory
(DRAM) that is synchronized with the system bus that can run at much higher clock speeds.
Microcontroller – Basic concept
Microcontroller – Basic concept
Address

Control

Boot Program Data Trans-


Some I/O
ROM ROM RAM ducers
CPU

Data

Microcontroller - put a limited amount of most commonly used resources inside


one chip
Microcontroller
● µC @ microcomputer within a single Integrated Circuit (IC), single-chip
microcomputer.
● Contains on-chip resources (RAM, ROM, I/O), typically used in
embedded applications.
● µC may not require extra off-chip resources to function.

No matter what is the system


size, the most important
component is still the
processor.
Microprocessor vs Microcontroller

No matter what is the system size, the most important component is still the processor.
Microcontroller Examples
§ Altera: Nios 16-bit, Nios II 32-bit configurable soft microprocessor
§ Atmel: AT89 series (Intel 8051 architecture), AT90, ATtiny, ATmega, ATxmega
series (AVR architecture) (Atmel Norway design), AT91SAM (ARM
architecture), AVR32 (32-bit AVR architecture) (Atmel Norway design),
MARC4…
§ Freescale/Motorola: Freescale S08, 68HC05, 68HC08, 68HC11, Freescale
S12, 68HC12, 68HC16, Freescale DSP56800 (DSP controller)…
§ Infineon: XE166 family, XC 2000 family, C166 family, C167 family,
Infineon XMC4000, TriCore™ family …
§ Intel: MCS-48 8048 family (8035, 8038, 8039, etc), MCS-51 8051 family
( 8X31, 8X32, 8X52, etc), MCS-151…
§ NXP Semiconductors: ARM7, ARM9, ARM Cortex-M0, ARM Cortex-M3…
§ Panasonic: …
§ Parallax: ….
§ Rockwell: …
§ …
Processor or
Central Processing Unit (CPU)
To perform the arithmetic and logical operations within the CPU

A set of internal storage locations within the CPU

Address Bus
Registers

Internal Bus
Data Bus
ALU

Control Control Bus


Unit

To synchronize and control the overall operation of the µP system


To decode instruction and pass the necessary control signals to CU
Processor or Central Processing Unit (CPU)
Menyimpan
maklumat Memproses

Daftar
n ALU
a
m
al
a
d Bas alamat
s
a
B
Bas data
Unit kawalan
Bas kawalan

Mengawal
Inside the CPU
● PC (Program Counter)
● Instruction decoder
● ALU (Arithmetic Logic Unit)
● Registers
ALU PC A
B

CPU C
D
Instruction decoder registers
Inside the CPU
ponents Functions
Program Counter (PC) a special-purpose register that is used by the processor to
hold the address of the next instruction to be executed.
Instruction Register (IR) Part of a CPU's control unit that stores the instruction
currently being executed or decoded
Instruction Decoder To translate/convert an instruction code into CPU control signals

Arithmetic and Logic Unit A digital circuit used to perform arithmetic and logic
(ALU) operations. It represents the fundamental building block
of the central processing unit (CPU) of a computer.

Registers The highest level of the memory hierarchy in a CPU. A


register may hold a computer instruction, a storage
address, or any kind of data (such as a bit sequence or
individual characters).
Processor (CPU): Registers

User-Visible Registers
Control & Instruction Registers

Program Counter (PC) General-Purpose Reg. (GPR)


Instruction Register (IR) Address Register
... Data Register
...
Flag Register
Instruction Cycle (Fetch-Execute)
● The processor executes instructions one-by-one according to the
sequence found in memory
● Everything is controlled by the control unit in the CPU.
● To execute an instruction, the processor must fetch it from memory.
● The complete steps the processor takes to execute one instruction is
the instruction cycle or the fetch-execute cycle

Fetch Execute
Instruction Cycle Details
● On program start:
• 0. Load the program counter (PC) with the address of the first
instruction

● Fetch phase:
1. Read the instruction and put it into the instruction register (IR)
2. Control unit decodes the instruction; updates the PC for
the next instruction

● Execute phase:
3. Find the data required by the instruction.
4. Perform the required operation.
5. Store the results.
6. Repeat from Step 1.
Instruction Cycle
Operation of a Processor
While (in operation)
Fetch instruction pointed by PC
Increment PC to point to next Instruction
Decode Instruction
Load 1st Operand (if any)
Load 2nd Operand (if any)
Execute Instruction
End While
How computers work 0 31h
1 C4h Aß [17]
2 26h BßA
A ß [6]

VCC
3 81h
4 EAh
AßA+B
[7]ßA
5 0h

A0-An-1
6 5h

GND

D0-D7
7

WE

OE
CS
Logic circuit
Address bus

Data bus
Control bus Write
Read

ALU
CPU A
B
PC: 10 C
D I/O 16 I/O 17 I/O 18 I/O n
Inst. Dec. registers
How computers work 0 31h
1 C4h Aß [17]
2 26h BßA
A ß [6]

VCC
3 81h
EAh
AßA+B
4
[7]ßA
5 0h

A0-An-1
5h

GND
6

D0-D7

WE
7

OE
CS
Logic circuit
Address bus 17

Data bus
Control bus Write
Read

ALU
CPU A
B
PC: 1 C 9

D I/O 16 I/O 17 I/O 18 I/O n


Inst. Dec. registers

31
How computers work 0 31h
1 C4
C4h Aß [17]
2 26h
26 BßA
A ß [6]

VCC
3 81h
4 EAh
AßA+B
[7]ßA
5 0h
5 5h

A0-An-1
6

GND

D0-D7
7

WE

OE
CS
Logic circuit
Address bus 17
6

Data bus
Control bus Write
Read

ALU
CPU A
B
9

PC: 231 C
D I/O 16 I/O 17 I/O 18 I/O n
Inst. Dec. registers
How computers work 0 31h
1 C4h Aß [17]
2 26h BßA
A ß [6]

VCC
3 81
81h
4 EA
EAh
AßA+B
[7]ßA
5 0h

A0-An-1
6 5h

GND

D0-D7
7

WE

OE
CS
7 Logic circuit
Address bus
Eh
Data bus
Control bus Write
Read

+
ALU
E CPU A
55 E

99
B
PC: 3454 C
D I/O 16 I/O 17 I/O 18 I/O n
Inst. Dec. registers
How Instruction decoder works Opcode Operand
Opcode Operand

Instruction

Instruction

Operation Code Meaning


000 Aß x
0011 0001 0 31h
Aß [17] 001 A ß [x]
1100 0100 1 C4h B ß A
0010 0110 2 26h
A ß [6] 010 A ß A – register (x)
1000 0001 3 81h AßA+B
1110 1010 4 EAh [7]ßA
011 Aß A+ x
5 0h
0000 0000
100 A ß A + register (x)
0000 0101 6 5h
7 101 Aß A– x
110 Register (xH) ß Register (xL)
111 [x] ß A

17 = 10001b
Selecting a Microprocessor
● Choose the right one for your application
– Primary criteria: Cost, Power, Size, Speed
– Others: package options, integrated peripherals, potential for future growth

● Choose one with good software development support


– development environment - good compiler and debugger availability
– evaluation boards
– in-circuit emulators for those with deep pockets
– Operating system availability

● Other considerations
– Code density: affects power consumption, performance and system cost
– Hardware availability: make sure you can actually purchase the
microcontroller before designing it in
– Prior expertise, licensing, etc
Review Questions 1

35
Review Questions 2

36
Review Questions 2 (Cont’d)

37
Summary
● Microprocessors and embedded controllers are a ubiquitous part of
life today
● Concept of a microprocessor & microcontroller
● Understand how a µP works
● Engineers familiar with µC, µP design are in the highest possible
demand
● Web Resources:
– How Microprocessors Work:
• http://computer.howstuffworks.com/microprocessor.htm
• http://www.intel.com/education/mpworks/
• http://www.cse.psu.edu/~cg471/03f/hw/pj5/how-micro.html
– Great Microprocessors of the Past and Present:
• http://www.sasktelwebsite.net/jbayko/cpu.html
– Great Moments in Microprocessor History:
• http://www-128.ibm.com/developerworks/library/pa-microhist.html

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy