Professional Documents
Culture Documents
Administrative:
textbook:
M. Mazidi, J. Mazidi, and R. McKinlay,
The 8051 Microcontroller and Embedded
Systems Using Assembly and C,
Pearson International Edition, 2006. ISBN:
0-13-197089-5
Number systems
Number = value
Base of a numeral
1 as binary: 00000001
Combinational
Sequential
D-latch
D-ipop
Synchronous:
Asynchronous
Counter
possible to reset
option to load
How to build it
Access to elements
R/W
Read-Write
Register le
busA
<31:0>
Clk
busW
Write
Enable
32
32
busA
5 5
Rw Ra
32 32-bit
Registers
D<31:0>
load
clk
contains 32 registers, 3 shown
D<31:0>
load
clk
D<31:0>
load
clk
Clk
busW
1
:
3
2
d
e
m
u
x Write
Enable
Rw<4:0> Ra<4:0>
3
2
:
1
m
u
x
Q
Q
Q
Example with
32 registers
(5-bit addressable)
Bus
Internal or external
Serial or parallel
How to share?
Tri-state output
Arbitration policy
(master-slave, peer-to-peer, etc)
1 2
3
to bus
output
enable
ALU: Arithmetic and Logical
Unit
Data inputs (example: 32 bits)
AInput, BInput: operands
Control signal (3 bits for up to 8 operators)
ALUCtl: add, addu, sub, subu, and, or, xor, nor
Data output
Result: 32-bits
N, Z, C, V ags
32
32
ALUctl
ALU
N,Z,C,V
Result
AInput
BInput
32
3
What's inside an ALU?
Giant mux that inputs from Adder,
addu'er, ...
16
<31:0>
ALUctl
N,Z,C,V
Result
AInput
BInput
8
:
1
m
u
x
add
addu
sub
subu
and
or
xor
nor
AddOut
AdduOut
SubOut
SubuOut
AndOut
OrOut
XorOut
NorOut
MuxOut
<35:0>
<35:32>
Detailed connection of each unit
Giant mux that inputs from Adder,
addu'er, ...
17
<31:0>
ALUctl
N,Z,C,V
Result
AInput
BInput
8
:
1
m
u
x
add
addu
sub
subu
and
or
xor
nor
AddOut
AdduOut
SubOut
SubuOut
AndOut
OrOut
XorOut
NorOut
MuxOut
<35:0>
add
AInput
BInput
+
NZCV
AddOut
<35:0>
AddOut
<31:0>
AddOut
<35:32>
<31>
<35:32>
Structure of a CPU
Datapath
ALU
Register le
Control
Instruction decoder
Program counter
Advantages of MCUs
Embedded systems
Choose a microcontroller
Microcontroller (MCU)
Embedded Microprocessor
Older
Newer
ATMega (Atmel)
Hitachi H8
NAND-ash
NOR-ash
used in breadboards
connect on bottom
small or no leads
socket
Computing needs