SlideShare a Scribd company logo
1 of 5
Central Processing Unit 1 Lecture 27
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Program Control
 Introduction
 General Register Organization
 Stack Organization
 Instruction Formats
 Addressing Modes
 Data Transfer and Manipulation
 Program Control
Program Interrupt
 Reduced Instruction Set Computer
Central Processing Unit 2 Lecture 27
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Program Control Instruction
PC
+1
In-Line Sequencing (Next instruction is fetched from the
next adjacent location in the memory)
Address from other source; Current Instruction, Stack, etc;
Branch, Conditional Branch, Subroutine, etc
• Program Control Instructions
Name Mnemonic
Branch BR
Jump JMP
Skip SKP
Call CALL
Return RTN
Compare(by  ) CMP
Test(by AND) TST * CMP and TST instructions do not retain their
results of operations (  and AND, resp.).
They only set or clear certain Flags.
Central Processing Unit 3 Lecture 27
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Conditional Branch Instruction
BZ Branch if zero Z = 1
BNZ Branch if not zero Z = 0
BC Branch if carry C = 1
BNC Branch if no carry C = 0
BP Branch if plus S = 0
BM Branch if minus S = 1
BV Branch if overflow V = 1
BNV Branch if no overflow V = 0
BHI Branch if higher A > B
BHE Branch if higher or equal A  B
BLO Branch if lower A < B
BLOE Branch if lower or equal A  B
BE Branch if equal A = B
BNE Branch if not equal A  B
BGT Branch if greater than A > B
BGE Branch if greater or equal A  B
BLT Branch if less than A < B
BLE Branch if less or equal A  B
BE Branch if equal A = B
BNE Branch if not equal A  B
Unsigned compare conditions (A - B)
Signed compare conditions (A - B)
Mnemonic Branch condition Tested condition
Central Processing Unit 4 Lecture 27
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Subroutine Call and Return
Call subroutine
Jump to subroutine
Branch to subroutine
Branch and save return address
• Fixed Location in the subroutine (Memory)
• Fixed Location in memory
• In a processor Register
• In memory stack
- most efficient way
• Subroutine Call
• Two Most Important Operations are Implied;
* Branch to the beginning of the Subroutine
- Same as the Branch or Conditional Branch
* Save the Return Address to get the address of the location in the Calling Program upon
exit from the Subroutine
• Locations for storing Return Address
CALL
SP  SP - 1
M[SP]  PC
PC  EA
RTN
PC  M[SP]
SP  SP + 1
Central Processing Unit 5 Lecture 27
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Flag, Processor Status Word
• In Basic Computer, the processor had several (status) flags – 1 bit value that
indicated various information about the processor’s state – E, FGI, FGO, I,
IEN, R
• In some processors, flags like these are often combined into a register – the
processor status register (PSR); sometimes called a processor status word
(PSW)
• Common flags in PSW are
– C (Carry): Set to 1 if the carry out of the ALU is 1
– S (Sign): The MSB bit of the ALU’s output
– Z (Zero): Set to 1 if the ALU’s output is all 0’s
– V (Overflow): Set to 1 if there is an overflow
Status Flag Circuit
c7
c8
A B
8 8
8-bit ALU
V Z S C
F7
F7 - F0
8
F
Check for
zero output

More Related Content

What's hot

Процессорын архитектур
Процессорын архитектурПроцессорын архитектур
Процессорын архитектур
Muuluu
 
Data Manipulation
Data ManipulationData Manipulation
Data Manipulation
Asfi Bhai
 
Chapter 3 - Top Level View of Computer / Function and Interconection
Chapter 3 - Top Level View of Computer / Function and InterconectionChapter 3 - Top Level View of Computer / Function and Interconection
Chapter 3 - Top Level View of Computer / Function and Interconection
César de Souza
 
Computer organiztion6
Computer organiztion6Computer organiztion6
Computer organiztion6
Umang Gupta
 

What's hot (20)

Lecture 39
Lecture 39Lecture 39
Lecture 39
 
Lecture 46
Lecture 46Lecture 46
Lecture 46
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 
Lecture 37
Lecture 37Lecture 37
Lecture 37
 
Lecture 47
Lecture 47Lecture 47
Lecture 47
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Процессорын архитектур
Процессорын архитектурПроцессорын архитектур
Процессорын архитектур
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Program control
Program controlProgram control
Program control
 
Data Manipulation
Data ManipulationData Manipulation
Data Manipulation
 
Bca 2nd sem-u-3-basic computer programming and micro programmed control
Bca 2nd sem-u-3-basic computer programming and micro programmed controlBca 2nd sem-u-3-basic computer programming and micro programmed control
Bca 2nd sem-u-3-basic computer programming and micro programmed control
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 
CPU Organization,Datatransfer and manipulation
CPU Organization,Datatransfer and manipulationCPU Organization,Datatransfer and manipulation
CPU Organization,Datatransfer and manipulation
 
Chapter 3 - Top Level View of Computer / Function and Interconection
Chapter 3 - Top Level View of Computer / Function and InterconectionChapter 3 - Top Level View of Computer / Function and Interconection
Chapter 3 - Top Level View of Computer / Function and Interconection
 
Lecture 14
Lecture 14Lecture 14
Lecture 14
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Computer organiztion6
Computer organiztion6Computer organiztion6
Computer organiztion6
 

Similar to Lecture 27

notes_Lecture-8 (Computer Architecture) 3rd Semester 2k11 (1).pdf
notes_Lecture-8 (Computer Architecture) 3rd Semester 2k11 (1).pdfnotes_Lecture-8 (Computer Architecture) 3rd Semester 2k11 (1).pdf
notes_Lecture-8 (Computer Architecture) 3rd Semester 2k11 (1).pdf
SatyamMishra828076
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
Mahesh Kumar Attri
 

Similar to Lecture 27 (20)

Lecture 21
Lecture 21Lecture 21
Lecture 21
 
notes_Lecture-8 (Computer Architecture) 3rd Semester 2k11 (1).pdf
notes_Lecture-8 (Computer Architecture) 3rd Semester 2k11 (1).pdfnotes_Lecture-8 (Computer Architecture) 3rd Semester 2k11 (1).pdf
notes_Lecture-8 (Computer Architecture) 3rd Semester 2k11 (1).pdf
 
Cpu unit
Cpu unitCpu unit
Cpu unit
 
Pipelining And Vector Processing
Pipelining And Vector ProcessingPipelining And Vector Processing
Pipelining And Vector Processing
 
embedded system and computer architecure
embedded system and computer architecureembedded system and computer architecure
embedded system and computer architecure
 
CAO-Unit-I.pptx
CAO-Unit-I.pptxCAO-Unit-I.pptx
CAO-Unit-I.pptx
 
PCB_6609.pptx
PCB_6609.pptxPCB_6609.pptx
PCB_6609.pptx
 
PCB_6609.pptx
PCB_6609.pptxPCB_6609.pptx
PCB_6609.pptx
 
Cpu execution
Cpu executionCpu execution
Cpu execution
 
Computer Organization and Architecture 10th - William Stallings, Ch01.pdf
Computer Organization and Architecture 10th - William Stallings, Ch01.pdfComputer Organization and Architecture 10th - William Stallings, Ch01.pdf
Computer Organization and Architecture 10th - William Stallings, Ch01.pdf
 
System Software module 1
System Software module 1System Software module 1
System Software module 1
 
4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]
 
4bit PC report
4bit PC report4bit PC report
4bit PC report
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
 
Unit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdf
Unit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdfUnit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdf
Unit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdf
 
Assembler
AssemblerAssembler
Assembler
 
Lecture 15
Lecture 15Lecture 15
Lecture 15
 
pdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptpdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.ppt
 
CS304PC:Computer Organization and Architecture Session 15 program control.pptx
CS304PC:Computer Organization and Architecture Session 15 program control.pptxCS304PC:Computer Organization and Architecture Session 15 program control.pptx
CS304PC:Computer Organization and Architecture Session 15 program control.pptx
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
 

More from RahulRathi94 (11)

Lecture 44
Lecture 44Lecture 44
Lecture 44
 
Lecture 43
Lecture 43Lecture 43
Lecture 43
 
Lecture 42
Lecture 42Lecture 42
Lecture 42
 
Lecture 41
Lecture 41Lecture 41
Lecture 41
 
Lecture 40
Lecture 40Lecture 40
Lecture 40
 
Lecture 35
Lecture 35Lecture 35
Lecture 35
 
Lecture 19
Lecture 19Lecture 19
Lecture 19
 
Lecture 17
Lecture 17Lecture 17
Lecture 17
 
Lecture 16
Lecture 16Lecture 16
Lecture 16
 
Lecture 13
Lecture 13Lecture 13
Lecture 13
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Lecture 27

  • 1. Central Processing Unit 1 Lecture 27 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Program Control  Introduction  General Register Organization  Stack Organization  Instruction Formats  Addressing Modes  Data Transfer and Manipulation  Program Control Program Interrupt  Reduced Instruction Set Computer
  • 2. Central Processing Unit 2 Lecture 27 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Program Control Instruction PC +1 In-Line Sequencing (Next instruction is fetched from the next adjacent location in the memory) Address from other source; Current Instruction, Stack, etc; Branch, Conditional Branch, Subroutine, etc • Program Control Instructions Name Mnemonic Branch BR Jump JMP Skip SKP Call CALL Return RTN Compare(by  ) CMP Test(by AND) TST * CMP and TST instructions do not retain their results of operations (  and AND, resp.). They only set or clear certain Flags.
  • 3. Central Processing Unit 3 Lecture 27 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Conditional Branch Instruction BZ Branch if zero Z = 1 BNZ Branch if not zero Z = 0 BC Branch if carry C = 1 BNC Branch if no carry C = 0 BP Branch if plus S = 0 BM Branch if minus S = 1 BV Branch if overflow V = 1 BNV Branch if no overflow V = 0 BHI Branch if higher A > B BHE Branch if higher or equal A  B BLO Branch if lower A < B BLOE Branch if lower or equal A  B BE Branch if equal A = B BNE Branch if not equal A  B BGT Branch if greater than A > B BGE Branch if greater or equal A  B BLT Branch if less than A < B BLE Branch if less or equal A  B BE Branch if equal A = B BNE Branch if not equal A  B Unsigned compare conditions (A - B) Signed compare conditions (A - B) Mnemonic Branch condition Tested condition
  • 4. Central Processing Unit 4 Lecture 27 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Subroutine Call and Return Call subroutine Jump to subroutine Branch to subroutine Branch and save return address • Fixed Location in the subroutine (Memory) • Fixed Location in memory • In a processor Register • In memory stack - most efficient way • Subroutine Call • Two Most Important Operations are Implied; * Branch to the beginning of the Subroutine - Same as the Branch or Conditional Branch * Save the Return Address to get the address of the location in the Calling Program upon exit from the Subroutine • Locations for storing Return Address CALL SP  SP - 1 M[SP]  PC PC  EA RTN PC  M[SP] SP  SP + 1
  • 5. Central Processing Unit 5 Lecture 27 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Flag, Processor Status Word • In Basic Computer, the processor had several (status) flags – 1 bit value that indicated various information about the processor’s state – E, FGI, FGO, I, IEN, R • In some processors, flags like these are often combined into a register – the processor status register (PSR); sometimes called a processor status word (PSW) • Common flags in PSW are – C (Carry): Set to 1 if the carry out of the ALU is 1 – S (Sign): The MSB bit of the ALU’s output – Z (Zero): Set to 1 if the ALU’s output is all 0’s – V (Overflow): Set to 1 if there is an overflow Status Flag Circuit c7 c8 A B 8 8 8-bit ALU V Z S C F7 F7 - F0 8 F Check for zero output