SlideShare a Scribd company logo
Microprocessor-Based Systems
Dr. Randa Elanwar
Lecture 2
Lecture Content
• Microprocessor ALSU functions
– Arithmetic operations
– Logical operations
– Shift operations
– Complete instruction set
• Microprocessor 8 bits bus architecture
• Microprocessor 8/16 bits bus architecture
2Microprocessor-Based Systems Dr. Randa Elanwar
Microprocessor bus architecture and
instruction sets
• Arithmetic Logic Shift Unit (Addition)
x7x6x5x4 x3x2x1x0
+
y7y6y5y4 y3y2y1y0
3Microprocessor-Based Systems Dr. Randa Elanwar
Full
Adder7
y7 x7
c7 z7
Full
Adder1
y1 x1
c1 z1
Full
Adder0
y0 x0
c0 z0
………
MUX
k1
cin
CF
D Q
CLK
CFout
GND
K1 instruction Meaning
0 ADD X, Y Z = X plus Y
1 ADC X, Y Z = X plus Y plus CFout
Microprocessor bus architecture and
instruction sets
• Arithmetic Logic Shift Unit (Addition)
• If we want to increment x:
• Let Y = 1 or (Y=0 and Cin = 1)
4Microprocessor-Based Systems Dr. Randa Elanwar
Full
Adder7
y7
x7
c7 z7
Full
Adder1
y1
x1
c1 z1
Full
Adder0
y0
x0
c0 z0
………
MUX
k3
cin
CF
D Q
CLK
CFout
GND
MUX
k1
1
k3
K3 K1 instruction Meaning
1 0 ADD X, Y Z = X plus Y
1 1 ADC X, Y Z = X plus Y plus CFout
0 1 Inc X Z = X plus 1
Microprocessor bus architecture and
instruction sets
• Arithmetic Logic Shift Unit (Subtraction)
• X minus Y = X plus 2’s complement of Y
• The carry is complemented and becomes a borrow bit
5Microprocessor-Based Systems Dr. Randa Elanwar
Full
Adder7
y7
x7
c7 z7
Full
Adder1
y1
x1
c1 z1
Full
Adder0
y0
x0
c0 z0
………
MUX
k3
cin
CF
D Q
CLK
CFout
GND
MUX
k1
1
k3
k2
Microprocessor bus architecture and
instruction sets
• Arithmetic Logic Shift Unit (Subtraction)
• 2’s complement of Y = (1’s complement of Y) + 1
• 1’s complement can be implemented by XOR gate: (Y xor 0 = Y), (Y xor 1 = Y’)
6Microprocessor-Based Systems Dr. Randa Elanwar
Full
Adder7
y7
x7
c7 z7
Full
Adder1
y1
x1
c1 z1
Full
Adder0
y0
x0
c0 z0
………
MUX
k3
cin
CF
D Q
CLK
CFout
GND
MUX
k1
1
k3
k2
Microprocessor bus architecture and
instruction sets
• Arithmetic Logic Shift Unit (Subtraction)
• 2’s complement of Y = (1’s complement of Y) + 1
• ‘1’ comes from the XOR gate at Cin
7Microprocessor-Based Systems Dr. Randa Elanwar
Full
Adder7
y7
x7
c7 z7
Full
Adder1
y1
x1
c1 z1
Full
Adder0
y0
x0
c0 z0
………
MUX
k3
cin
CF
D Q
CLK
CFout
GND
MUX
k1
1
k3
k2
Microprocessor bus architecture and
instruction sets
• Arithmetic Logic Shift Unit (Subtraction)
• The carry is complemented and becomes a borrow bit at XOR gate before
the carry flag and stored in it
8Microprocessor-Based Systems Dr. Randa Elanwar
Full
Adder7
y7
x7
c7 z7
Full
Adder1
y1
x1
c1 z1
Full
Adder0
y0
x0
c0 z0
………
MUX
k3
cin
CF
D Q
CLK
CFout
GND
MUX
k1
1
k3
k2
Microprocessor bus architecture and
instruction sets
Arithmetic Logic Shift Unit
• If k2 = 0 (addition) CF stores carry
• If k2 = 1 (subtraction) CF stores borrow
9Microprocessor-Based Systems Dr. Randa Elanwar
Full
Adder7
y7
x7
c7 z7
Full
Adder1
y1
x1
c1 z1
Full
Adder0
y0
x0
c0 z0
………
MUX
k3
cin
CF
D Q
CLK
CFout
GND
MUX
k1
1
k3
k2
K2K3 K1 instruction Meaning
1 1 0 ADD X, Y Z = X + Y
1 1 1 ADC X, Y Z = X + Y + CFout
1 1 0 SUB X, Y Z = X - Y
1 1 1 SBB X, Y Z = X - Y - BRW
0 0 1 Inc X Z = X + 1
1 0 1 DEC X Z = X - 1
Microprocessor bus architecture and
instruction sets
10Microprocessor-Based Systems Dr. Randa Elanwar
ALSU
Xin
Yin
Z
mode
•k1, k2 and k3 are the mode selection lines for
arithmetic operations
•There are more mode selection lines for logical
and shift operations
4x1 MUX 4x1 MUX
z7 z0
K4
K5
Shift Block
K1
K2
K3
……..
Logical Block
K1
K2
……..
Arithmetic
Block
K1
K2
K3
…….. z’0z’’0z’’’0z’’’7 z’’7 z’7
x0x7y0y7
K5 K4 Operation
0 0 Logic
0 1 Arithmetic
1 0 Shift
1 1 Not used
…….
Microprocessor bus architecture and
instruction sets
• Logical operations:
• If we want to AND X, Y
11Microprocessor-Based Systems Dr. Randa Elanwar
X 0101 0110 K1 K2 Operation
Y 1011 0101 0 0 AND
X.Y 0001 0100 1 0 XOR
0 1 OR
1 1 NOT
x7 x0 x7 x0 x7 x0 x7 x0y7 y0y7 y0y7 y0
4x1 MUX 4x1 MUX
z7 z0
K1
K2
…….
…….
……. ……. …….
……. ……. …….
…….
Microprocessor bus architecture and
instruction sets
• Shift operations:
• To shift in both directions
12Microprocessor-Based Systems Dr. Randa Elanwar
D Q D Q D Q
Rser in
… …
D Q D Q D Q
Rser in
MUXMUXMUX
The flip flop stores a
certain value, with
each clock 1 bit is
shifted to the right and
new data is stored
Microprocessor bus architecture and
instruction sets
• The ALSU shift unit:
• Shift can be used to perform arithmetic operations
• SAL: Shift Arithmetic Left (*) SAR: Shift Arithmetic Right (/)
0010  2 1000  8
0100  4 0100  4
1000  8 0010  2
13Microprocessor-Based Systems Dr. Randa Elanwar
……….
RSser in
LSser in
x0x1x2x3x4x5x6x7
z0z1z2z7
K1
K1 Operation
0 Shift left
1 Shift Right
Microprocessor bus architecture and
instruction sets
14Microprocessor-Based Systems Dr. Randa Elanwar
ROR: ROtate Right
The register restores the
original content after 8 clocks
RCR: Rotate through Carry Right
The register restores the original
content after 9 clocks
CF
CF
Microprocessor bus architecture and
instruction sets
• Full Instruction set
• K3 K2 K1 instruction Operation
• 0 0 0 SHL Shift X by 1 bit left (LSin=0)
• 0 0 1 SHR Shift X by 1 bit right (RSin=0)
• 0 1 0 SAL Shift arithmetic X by 1 position left (LSin=0)
• 0 1 1 SAR Shift arithmetic X by 1 position right (Rsin=x7)
• 1 0 0 ROL Rotate left X by 1 position (LSin=x7)
• 1 0 1 ROR Rotate right X by 1 position (LSin=x0)
• 1 1 0 RCL Rotate through carry left
• 1 1 1 RCR Rotate through carry right
15Microprocessor-Based Systems Dr. Randa Elanwar
Microprocessor bus architecture and
instruction sets
• Full Instruction set
• K5 K4 K2 K3 K1 instruction Meaning
• 0 1 0 1 0 ADD X, Y Z = X + Y
• 0 1 0 1 1 ADC X, Y Z = X + Y + Carry
• 0 1 1 1 0 SUB X, Y Z = X - Y
• 0 1 1 1 1 SBB X, Y Z = X - Y - Borrow
• 0 1 0 0 1 Inc X Z = X + 1
• 0 1 1 0 1 DEC X Z = X – 1
• 0 0 0 x 0 AND X, Y Z = X . Y
• 0 0 1 x 0 XOR X, Y Z = X Y
16Microprocessor-Based Systems Dr. Randa Elanwar
+
Microprocessor bus architecture and
instruction sets
• All the previous discussion was describing an ALSU
manipulating 8 bit (byte) data type.
• If we want to construct an ALSU manipulating 16 bit (word)
data type, the number of flip flops and gates has to be
doubled.
• If we want to construct an ALSU manipulating both 8 bit and
16 bit data, each ‘carry’ or ‘Most Significant Bit (MSB)’ has to
be passed through a multiplexer to select between (C7 and
C15) or (x7 and x15) with mode selection line k6.
17Microprocessor-Based Systems Dr. Randa Elanwar
Microprocessor bus architecture and
instruction sets
• 8 bit bus architecture
18Microprocessor-Based Systems Dr. Randa Elanwar
T2
CLKT2
Reg A
Reg B
Reg C
Reg D
CLKT1
T1
CF
CSALU
Xin
Yin
Z
ALSU
k5…k1
Reg E
Reg H
Reg L
All registers:
A, B, C, D, E,
H, L, T1 and
T2 are 8 bit
registers
The bus is
composed of
8 signaling
lines
Microprocessor bus architecture and
instruction sets
• 8 bit bus architecture
19Microprocessor-Based Systems Dr. Randa Elanwar
T2
CLKT2
Reg A
Reg B
Reg C
Reg D
CLKT1
T1
CF
CSALU
Xin
Yin
Z
ALSU
k5…k1
Reg E
Reg H
Reg L
ALSU is
composed of 8
bit Arithmetic,
logic, shift
units
ALSU has five
mode
selection lines
k1  k5
Microprocessor bus architecture and
instruction sets
• 8/16 bit bus architecture
20Microprocessor-Based Systems Dr. Randa Elanwar
T2
CLKT2
AH
BH
CH
DH
CLKT1
T1
CF
CSALU
Xin
Yin
Z
ALSU
k6…k0
SI
DI
AL
BL
CL
DL
All registers:
AX, BX, CX,
DX, SI, DI, T1
and T2 are
16 bit
registers
The bus is
composed
of 16
signaling
lines
Microprocessor bus architecture and
instruction sets
• 8/16 bit bus architecture
21Microprocessor-Based Systems Dr. Randa Elanwar
T2
CLKT2
AH
BH
CH
DH
CLKT1
T1
CF
CSALU
Xin
Yin
Z
ALSU
k6…k0
SI
DI
AL
BL
CL
DL
All registers:
e.g., AX is
composed of
2 parts AH
and AL to
hold the
Higher 8 bits
and the
Lower 8 bits.
Each has its
own CS
control signal
Microprocessor bus architecture and
instruction sets
• 8/16 bit bus architecture
22Microprocessor-Based Systems Dr. Randa Elanwar
T2
CLKT2
AH
BH
CH
DH
CLKT1
T1
CF
CSALU
Xin
Yin
Z
ALSU
k6…k0
SI
DI
AL
BL
CL
DL
AL, BL, CL, DL
are
connected to
the lower bus
lines while
AH, BH, CH,
DH are
connected to
the higher
bus lines
Microprocessor bus architecture and
instruction sets
• 8/16 bit bus architecture
23Microprocessor-Based Systems Dr. Randa Elanwar
T2
CLKT2
AH
BH
CH
DH
CLKT1
T1
CF
CSALU
Xin
Yin
Z
ALSU
k6…k0
SI
DI
AL
BL
CL
DL
ALSU has 16
bit units (H, L)
ALSU has six
mode
selection lines
k1  k6
k6 allows
working on
either 8 or 16
bit data type
Microprocessor bus architecture and
instruction sets
• 8/16 bit bus architecture
24Microprocessor-Based Systems Dr. Randa Elanwar
T2
CLKT2
AH
BH
CH
DH
CLKT1
T1
CF
CSALU
Xin
Yin
Z
ALSU
k6…k0
SI
DI
AL
BL
CL
DL
SI: source
index register,
16 bits
register, it has
only one CS
control.
DI: destination
index register,
16 bits
register, it has
only one CS
control.
Microprocessor bus architecture and
instruction sets
• 8/16 bit bus architecture: Instructions
• MOV BX, AX
– This instruction copies the content of AL to BL and AH to BH
– CS of AX (both AL, AH) is low, then
– CLK of BX (both BL, BH) is low
• MOV BL, AL
– This instruction copies the content of AL to BL only
– CS of AL only is low, then
– CLK of BL only is low
25Microprocessor-Based Systems Dr. Randa Elanwar
Microprocessor bus architecture and
instruction sets
• 8/16 bit bus architecture: Instructions
• MOV BH, AH
– This instruction copies the content of AH to BH only
– CS of AH only is low, then
– CLK of BH only is low
• MOV AH, AL
– Not possible
26Microprocessor-Based Systems Dr. Randa Elanwar
Microprocessor bus architecture and
instruction sets
• 8/16 bit bus architecture: Instructions
• MOV SI, AX
– This instruction copies the content of AX to SI
– CS of AX (both AL, AH) is low, then
– CLK of SI is low
• MOV SI, BL
– Not possible
– BL has 8 bits and SI is a one part 16 bit register
27Microprocessor-Based Systems Dr. Randa Elanwar
Microprocessor bus architecture and
instruction sets
• 8/16 bit bus architecture: Instructions
• MOV BX, DI
– This instruction copies the content of DI to BX
– CS of DI is low, then
– CLK of BX (both BL, BH) is low
• MOV SI, DI
– This instruction copies the content of DI to SI
– CS of DI is low, then
– CLK of SI is low
28Microprocessor-Based Systems Dr. Randa Elanwar

More Related Content

PPTX
Microprocessors-based systems (under graduate course) Lecture 1 of 9
PPTX
Microprocessors-based systems (under graduate course) Lecture 4 of 9
PPTX
Microprocessors-based systems (under graduate course) Lecture 3 of 9
PPTX
Microprocessors-based systems (under graduate course) Lecture 6 of 9
PPTX
Microprocessors-based systems (under graduate course) Lecture 8 of 9
PPTX
Microprocessors-based systems (under graduate course) Lecture 7 of 9
PPTX
Microprocessors-based systems (under graduate course) Lecture 5 of 9
PPT
8085 instruction-set part 1
Microprocessors-based systems (under graduate course) Lecture 1 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 3 of 9
Microprocessors-based systems (under graduate course) Lecture 6 of 9
Microprocessors-based systems (under graduate course) Lecture 8 of 9
Microprocessors-based systems (under graduate course) Lecture 7 of 9
Microprocessors-based systems (under graduate course) Lecture 5 of 9
8085 instruction-set part 1

What's hot (20)

PPTX
Timing Diagram.pptx
PPT
PPT
MICROPROCESSOR INPUT OUTPUT OPERATIONS
PPT
8085 MICROPROCESSOR
PPTX
Clock-8086 bus cycle
PDF
PPTX
PPT 8085 microprocessor
PDF
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
PDF
Detailed Explanation of Pin Description of 8085 microprocessor
PPTX
An introduction to microprocessor architecture using INTEL 8085 as a classic...
PDF
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
PPS
Microprocessor 8085 Chapter 4
PPTX
SHLD and LHLD instruction
PPT
Microprocessor and-interfacing-techbymak
PPTX
8085 microprocessor
PPT
8085 Microprocessor Architecture
PPT
Mp 8085
PPT
8085-microprocessor
Timing Diagram.pptx
MICROPROCESSOR INPUT OUTPUT OPERATIONS
8085 MICROPROCESSOR
Clock-8086 bus cycle
PPT 8085 microprocessor
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Detailed Explanation of Pin Description of 8085 microprocessor
An introduction to microprocessor architecture using INTEL 8085 as a classic...
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Microprocessor 8085 Chapter 4
SHLD and LHLD instruction
Microprocessor and-interfacing-techbymak
8085 microprocessor
8085 Microprocessor Architecture
Mp 8085
8085-microprocessor
Ad

Viewers also liked (19)

PPT
PPT
Lecture 1
PDF
Microprocessor and interfacing
PPTX
Microprocessors-based systems (under graduate course) Lecture 9 of 9
PPT
Microprocessor based system design
PPT
Interfacing ics for microprocessor
PPTX
Chapter5
PPT
Introduction to Interfacing Technique
PPT
1204 Ppi 8255
PPTX
Interfacing of 8255 IC By Er. Swapnil Kaware.
PPT
Unit – 2
PDF
Microprocessor and Interfacing Notes
PPT
Evolution Of Microprocessor
PPT
The Intel 8086 microprocessor
PPT
8085 Architecture & Memory Interfacing1
PPTX
Microprocessor 8086
PPT
Memory & I/O interfacing
PDF
NIVELES DE ESCRITURA DE EMILIA FERREIRO
PPT
8085 microprocessor architecture ppt
Lecture 1
Microprocessor and interfacing
Microprocessors-based systems (under graduate course) Lecture 9 of 9
Microprocessor based system design
Interfacing ics for microprocessor
Chapter5
Introduction to Interfacing Technique
1204 Ppi 8255
Interfacing of 8255 IC By Er. Swapnil Kaware.
Unit – 2
Microprocessor and Interfacing Notes
Evolution Of Microprocessor
The Intel 8086 microprocessor
8085 Architecture & Memory Interfacing1
Microprocessor 8086
Memory & I/O interfacing
NIVELES DE ESCRITURA DE EMILIA FERREIRO
8085 microprocessor architecture ppt
Ad

Similar to Microprocessors-based systems (under graduate course) Lecture 2 of 9 (20)

PDF
Architecture OF 8085
PDF
PDF
8085 microprocessor
PPTX
CPU ORGANIZATION CHAPTER FIVE COMPUTER ORGANIZATION.pptx
PDF
Microprocessor and microcontroller (MPMC).pdf
PDF
lecture1423813120.pdf
PPT
RTL,Instruction set _
PDF
Lecture Notes - Microprocessor - Unit 1 - Microprocessor Architecture and its...
PPTX
8085 microprocessor(1)
PDF
Architecture of 8085
PPTX
Register transfer and micro operation
PPTX
Co ppt
PDF
PPT
CAO 3 Unit 1 best of one presentation.ppt
PPTX
Register reference
PDF
8085 micro processor
PDF
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
PPT
Module 5 part1
PPT
Architecture OF 8085
8085 microprocessor
CPU ORGANIZATION CHAPTER FIVE COMPUTER ORGANIZATION.pptx
Microprocessor and microcontroller (MPMC).pdf
lecture1423813120.pdf
RTL,Instruction set _
Lecture Notes - Microprocessor - Unit 1 - Microprocessor Architecture and its...
8085 microprocessor(1)
Architecture of 8085
Register transfer and micro operation
Co ppt
CAO 3 Unit 1 best of one presentation.ppt
Register reference
8085 micro processor
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
Module 5 part1

More from Randa Elanwar (20)

PDF
الجزء السادس ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
PDF
الجزء الخامس ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
PDF
الجزء الرابع ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
PDF
الجزء الثالث ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
PDF
الجزء الثاني ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
PDF
الجزء الأول ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
PDF
تدريب مدونة علماء مصر على الكتابة الفنية (الترجمة والتلخيص )_Pdf5of5
PDF
تدريب مدونة علماء مصر على الكتابة الفنية (القصة القصيرة والخاطرة والأخطاء ال...
PDF
تدريب مدونة علماء مصر على الكتابة الفنية (مقالات الموارد )_Pdf3of5
PDF
تدريب مدونة علماء مصر على الكتابة الفنية (المقالات الإخبارية )_Pdf2of5
PDF
تدريب مدونة علماء مصر على الكتابة الفنية (المقالات المبنية على البحث )_Pdf1of5
PDF
تعريف بمدونة علماء مصر ومحاور التدريب على الكتابة للمدونين
PDF
Entrepreneurship_who_is_your_customer_(arabic)_7of7
PDF
Entrepreneurship_who_is_your_customer_(arabic)_5of7
PDF
Entrepreneurship_who_is_your_customer_(arabic)_4of7
PDF
Entrepreneurship_who_is_your_customer_(arabic)_2of7
PDF
يوميات طالب بدرجة مشرف (Part 19 of 20)
PDF
يوميات طالب بدرجة مشرف (Part 18 of 20)
PDF
يوميات طالب بدرجة مشرف (Part 17 of 20)
PDF
يوميات طالب بدرجة مشرف (Part 16 of 20)
الجزء السادس ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
الجزء الخامس ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
الجزء الرابع ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
الجزء الثالث ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
الجزء الثاني ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
الجزء الأول ماذا ستقدم لعميلك ريادة الأعمال خطوة بخطوة
تدريب مدونة علماء مصر على الكتابة الفنية (الترجمة والتلخيص )_Pdf5of5
تدريب مدونة علماء مصر على الكتابة الفنية (القصة القصيرة والخاطرة والأخطاء ال...
تدريب مدونة علماء مصر على الكتابة الفنية (مقالات الموارد )_Pdf3of5
تدريب مدونة علماء مصر على الكتابة الفنية (المقالات الإخبارية )_Pdf2of5
تدريب مدونة علماء مصر على الكتابة الفنية (المقالات المبنية على البحث )_Pdf1of5
تعريف بمدونة علماء مصر ومحاور التدريب على الكتابة للمدونين
Entrepreneurship_who_is_your_customer_(arabic)_7of7
Entrepreneurship_who_is_your_customer_(arabic)_5of7
Entrepreneurship_who_is_your_customer_(arabic)_4of7
Entrepreneurship_who_is_your_customer_(arabic)_2of7
يوميات طالب بدرجة مشرف (Part 19 of 20)
يوميات طالب بدرجة مشرف (Part 18 of 20)
يوميات طالب بدرجة مشرف (Part 17 of 20)
يوميات طالب بدرجة مشرف (Part 16 of 20)

Recently uploaded (20)

PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
RMMM.pdf make it easy to upload and study
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
master seminar digital applications in india
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
Cell Structure & Organelles in detailed.
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
RMMM.pdf make it easy to upload and study
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Microbial diseases, their pathogenesis and prophylaxis
A systematic review of self-coping strategies used by university students to ...
STATICS OF THE RIGID BODIES Hibbelers.pdf
Orientation - ARALprogram of Deped to the Parents.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Final Presentation General Medicine 03-08-2024.pptx
master seminar digital applications in india
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Cell Structure & Organelles in detailed.
O5-L3 Freight Transport Ops (International) V1.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
O7-L3 Supply Chain Operations - ICLT Program
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx

Microprocessors-based systems (under graduate course) Lecture 2 of 9

  • 2. Lecture Content • Microprocessor ALSU functions – Arithmetic operations – Logical operations – Shift operations – Complete instruction set • Microprocessor 8 bits bus architecture • Microprocessor 8/16 bits bus architecture 2Microprocessor-Based Systems Dr. Randa Elanwar
  • 3. Microprocessor bus architecture and instruction sets • Arithmetic Logic Shift Unit (Addition) x7x6x5x4 x3x2x1x0 + y7y6y5y4 y3y2y1y0 3Microprocessor-Based Systems Dr. Randa Elanwar Full Adder7 y7 x7 c7 z7 Full Adder1 y1 x1 c1 z1 Full Adder0 y0 x0 c0 z0 ……… MUX k1 cin CF D Q CLK CFout GND K1 instruction Meaning 0 ADD X, Y Z = X plus Y 1 ADC X, Y Z = X plus Y plus CFout
  • 4. Microprocessor bus architecture and instruction sets • Arithmetic Logic Shift Unit (Addition) • If we want to increment x: • Let Y = 1 or (Y=0 and Cin = 1) 4Microprocessor-Based Systems Dr. Randa Elanwar Full Adder7 y7 x7 c7 z7 Full Adder1 y1 x1 c1 z1 Full Adder0 y0 x0 c0 z0 ……… MUX k3 cin CF D Q CLK CFout GND MUX k1 1 k3 K3 K1 instruction Meaning 1 0 ADD X, Y Z = X plus Y 1 1 ADC X, Y Z = X plus Y plus CFout 0 1 Inc X Z = X plus 1
  • 5. Microprocessor bus architecture and instruction sets • Arithmetic Logic Shift Unit (Subtraction) • X minus Y = X plus 2’s complement of Y • The carry is complemented and becomes a borrow bit 5Microprocessor-Based Systems Dr. Randa Elanwar Full Adder7 y7 x7 c7 z7 Full Adder1 y1 x1 c1 z1 Full Adder0 y0 x0 c0 z0 ……… MUX k3 cin CF D Q CLK CFout GND MUX k1 1 k3 k2
  • 6. Microprocessor bus architecture and instruction sets • Arithmetic Logic Shift Unit (Subtraction) • 2’s complement of Y = (1’s complement of Y) + 1 • 1’s complement can be implemented by XOR gate: (Y xor 0 = Y), (Y xor 1 = Y’) 6Microprocessor-Based Systems Dr. Randa Elanwar Full Adder7 y7 x7 c7 z7 Full Adder1 y1 x1 c1 z1 Full Adder0 y0 x0 c0 z0 ……… MUX k3 cin CF D Q CLK CFout GND MUX k1 1 k3 k2
  • 7. Microprocessor bus architecture and instruction sets • Arithmetic Logic Shift Unit (Subtraction) • 2’s complement of Y = (1’s complement of Y) + 1 • ‘1’ comes from the XOR gate at Cin 7Microprocessor-Based Systems Dr. Randa Elanwar Full Adder7 y7 x7 c7 z7 Full Adder1 y1 x1 c1 z1 Full Adder0 y0 x0 c0 z0 ……… MUX k3 cin CF D Q CLK CFout GND MUX k1 1 k3 k2
  • 8. Microprocessor bus architecture and instruction sets • Arithmetic Logic Shift Unit (Subtraction) • The carry is complemented and becomes a borrow bit at XOR gate before the carry flag and stored in it 8Microprocessor-Based Systems Dr. Randa Elanwar Full Adder7 y7 x7 c7 z7 Full Adder1 y1 x1 c1 z1 Full Adder0 y0 x0 c0 z0 ……… MUX k3 cin CF D Q CLK CFout GND MUX k1 1 k3 k2
  • 9. Microprocessor bus architecture and instruction sets Arithmetic Logic Shift Unit • If k2 = 0 (addition) CF stores carry • If k2 = 1 (subtraction) CF stores borrow 9Microprocessor-Based Systems Dr. Randa Elanwar Full Adder7 y7 x7 c7 z7 Full Adder1 y1 x1 c1 z1 Full Adder0 y0 x0 c0 z0 ……… MUX k3 cin CF D Q CLK CFout GND MUX k1 1 k3 k2 K2K3 K1 instruction Meaning 1 1 0 ADD X, Y Z = X + Y 1 1 1 ADC X, Y Z = X + Y + CFout 1 1 0 SUB X, Y Z = X - Y 1 1 1 SBB X, Y Z = X - Y - BRW 0 0 1 Inc X Z = X + 1 1 0 1 DEC X Z = X - 1
  • 10. Microprocessor bus architecture and instruction sets 10Microprocessor-Based Systems Dr. Randa Elanwar ALSU Xin Yin Z mode •k1, k2 and k3 are the mode selection lines for arithmetic operations •There are more mode selection lines for logical and shift operations 4x1 MUX 4x1 MUX z7 z0 K4 K5 Shift Block K1 K2 K3 …….. Logical Block K1 K2 …….. Arithmetic Block K1 K2 K3 …….. z’0z’’0z’’’0z’’’7 z’’7 z’7 x0x7y0y7 K5 K4 Operation 0 0 Logic 0 1 Arithmetic 1 0 Shift 1 1 Not used …….
  • 11. Microprocessor bus architecture and instruction sets • Logical operations: • If we want to AND X, Y 11Microprocessor-Based Systems Dr. Randa Elanwar X 0101 0110 K1 K2 Operation Y 1011 0101 0 0 AND X.Y 0001 0100 1 0 XOR 0 1 OR 1 1 NOT x7 x0 x7 x0 x7 x0 x7 x0y7 y0y7 y0y7 y0 4x1 MUX 4x1 MUX z7 z0 K1 K2 ……. ……. ……. ……. ……. ……. ……. ……. …….
  • 12. Microprocessor bus architecture and instruction sets • Shift operations: • To shift in both directions 12Microprocessor-Based Systems Dr. Randa Elanwar D Q D Q D Q Rser in … … D Q D Q D Q Rser in MUXMUXMUX The flip flop stores a certain value, with each clock 1 bit is shifted to the right and new data is stored
  • 13. Microprocessor bus architecture and instruction sets • The ALSU shift unit: • Shift can be used to perform arithmetic operations • SAL: Shift Arithmetic Left (*) SAR: Shift Arithmetic Right (/) 0010  2 1000  8 0100  4 0100  4 1000  8 0010  2 13Microprocessor-Based Systems Dr. Randa Elanwar ………. RSser in LSser in x0x1x2x3x4x5x6x7 z0z1z2z7 K1 K1 Operation 0 Shift left 1 Shift Right
  • 14. Microprocessor bus architecture and instruction sets 14Microprocessor-Based Systems Dr. Randa Elanwar ROR: ROtate Right The register restores the original content after 8 clocks RCR: Rotate through Carry Right The register restores the original content after 9 clocks CF CF
  • 15. Microprocessor bus architecture and instruction sets • Full Instruction set • K3 K2 K1 instruction Operation • 0 0 0 SHL Shift X by 1 bit left (LSin=0) • 0 0 1 SHR Shift X by 1 bit right (RSin=0) • 0 1 0 SAL Shift arithmetic X by 1 position left (LSin=0) • 0 1 1 SAR Shift arithmetic X by 1 position right (Rsin=x7) • 1 0 0 ROL Rotate left X by 1 position (LSin=x7) • 1 0 1 ROR Rotate right X by 1 position (LSin=x0) • 1 1 0 RCL Rotate through carry left • 1 1 1 RCR Rotate through carry right 15Microprocessor-Based Systems Dr. Randa Elanwar
  • 16. Microprocessor bus architecture and instruction sets • Full Instruction set • K5 K4 K2 K3 K1 instruction Meaning • 0 1 0 1 0 ADD X, Y Z = X + Y • 0 1 0 1 1 ADC X, Y Z = X + Y + Carry • 0 1 1 1 0 SUB X, Y Z = X - Y • 0 1 1 1 1 SBB X, Y Z = X - Y - Borrow • 0 1 0 0 1 Inc X Z = X + 1 • 0 1 1 0 1 DEC X Z = X – 1 • 0 0 0 x 0 AND X, Y Z = X . Y • 0 0 1 x 0 XOR X, Y Z = X Y 16Microprocessor-Based Systems Dr. Randa Elanwar +
  • 17. Microprocessor bus architecture and instruction sets • All the previous discussion was describing an ALSU manipulating 8 bit (byte) data type. • If we want to construct an ALSU manipulating 16 bit (word) data type, the number of flip flops and gates has to be doubled. • If we want to construct an ALSU manipulating both 8 bit and 16 bit data, each ‘carry’ or ‘Most Significant Bit (MSB)’ has to be passed through a multiplexer to select between (C7 and C15) or (x7 and x15) with mode selection line k6. 17Microprocessor-Based Systems Dr. Randa Elanwar
  • 18. Microprocessor bus architecture and instruction sets • 8 bit bus architecture 18Microprocessor-Based Systems Dr. Randa Elanwar T2 CLKT2 Reg A Reg B Reg C Reg D CLKT1 T1 CF CSALU Xin Yin Z ALSU k5…k1 Reg E Reg H Reg L All registers: A, B, C, D, E, H, L, T1 and T2 are 8 bit registers The bus is composed of 8 signaling lines
  • 19. Microprocessor bus architecture and instruction sets • 8 bit bus architecture 19Microprocessor-Based Systems Dr. Randa Elanwar T2 CLKT2 Reg A Reg B Reg C Reg D CLKT1 T1 CF CSALU Xin Yin Z ALSU k5…k1 Reg E Reg H Reg L ALSU is composed of 8 bit Arithmetic, logic, shift units ALSU has five mode selection lines k1  k5
  • 20. Microprocessor bus architecture and instruction sets • 8/16 bit bus architecture 20Microprocessor-Based Systems Dr. Randa Elanwar T2 CLKT2 AH BH CH DH CLKT1 T1 CF CSALU Xin Yin Z ALSU k6…k0 SI DI AL BL CL DL All registers: AX, BX, CX, DX, SI, DI, T1 and T2 are 16 bit registers The bus is composed of 16 signaling lines
  • 21. Microprocessor bus architecture and instruction sets • 8/16 bit bus architecture 21Microprocessor-Based Systems Dr. Randa Elanwar T2 CLKT2 AH BH CH DH CLKT1 T1 CF CSALU Xin Yin Z ALSU k6…k0 SI DI AL BL CL DL All registers: e.g., AX is composed of 2 parts AH and AL to hold the Higher 8 bits and the Lower 8 bits. Each has its own CS control signal
  • 22. Microprocessor bus architecture and instruction sets • 8/16 bit bus architecture 22Microprocessor-Based Systems Dr. Randa Elanwar T2 CLKT2 AH BH CH DH CLKT1 T1 CF CSALU Xin Yin Z ALSU k6…k0 SI DI AL BL CL DL AL, BL, CL, DL are connected to the lower bus lines while AH, BH, CH, DH are connected to the higher bus lines
  • 23. Microprocessor bus architecture and instruction sets • 8/16 bit bus architecture 23Microprocessor-Based Systems Dr. Randa Elanwar T2 CLKT2 AH BH CH DH CLKT1 T1 CF CSALU Xin Yin Z ALSU k6…k0 SI DI AL BL CL DL ALSU has 16 bit units (H, L) ALSU has six mode selection lines k1  k6 k6 allows working on either 8 or 16 bit data type
  • 24. Microprocessor bus architecture and instruction sets • 8/16 bit bus architecture 24Microprocessor-Based Systems Dr. Randa Elanwar T2 CLKT2 AH BH CH DH CLKT1 T1 CF CSALU Xin Yin Z ALSU k6…k0 SI DI AL BL CL DL SI: source index register, 16 bits register, it has only one CS control. DI: destination index register, 16 bits register, it has only one CS control.
  • 25. Microprocessor bus architecture and instruction sets • 8/16 bit bus architecture: Instructions • MOV BX, AX – This instruction copies the content of AL to BL and AH to BH – CS of AX (both AL, AH) is low, then – CLK of BX (both BL, BH) is low • MOV BL, AL – This instruction copies the content of AL to BL only – CS of AL only is low, then – CLK of BL only is low 25Microprocessor-Based Systems Dr. Randa Elanwar
  • 26. Microprocessor bus architecture and instruction sets • 8/16 bit bus architecture: Instructions • MOV BH, AH – This instruction copies the content of AH to BH only – CS of AH only is low, then – CLK of BH only is low • MOV AH, AL – Not possible 26Microprocessor-Based Systems Dr. Randa Elanwar
  • 27. Microprocessor bus architecture and instruction sets • 8/16 bit bus architecture: Instructions • MOV SI, AX – This instruction copies the content of AX to SI – CS of AX (both AL, AH) is low, then – CLK of SI is low • MOV SI, BL – Not possible – BL has 8 bits and SI is a one part 16 bit register 27Microprocessor-Based Systems Dr. Randa Elanwar
  • 28. Microprocessor bus architecture and instruction sets • 8/16 bit bus architecture: Instructions • MOV BX, DI – This instruction copies the content of DI to BX – CS of DI is low, then – CLK of BX (both BL, BH) is low • MOV SI, DI – This instruction copies the content of DI to SI – CS of DI is low, then – CLK of SI is low 28Microprocessor-Based Systems Dr. Randa Elanwar