SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulationSanjeev Patel
 
Процессорын архитектур
Процессорын архитектурПроцессорын архитектур
Процессорын архитектурMuuluu
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulationrajshreemuthiah
 
Data Manipulation
Data ManipulationData Manipulation
Data ManipulationAsfi Bhai
 
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 controlRai University
 
CPU Organization,Datatransfer and manipulation
CPU Organization,Datatransfer and manipulationCPU Organization,Datatransfer and manipulation
CPU Organization,Datatransfer and manipulationNITISH KUMAR
 
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 InterconectionCésar de Souza
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulationjanani thirupathi
 
Computer organiztion6
Computer organiztion6Computer organiztion6
Computer organiztion6Umang Gupta
 

Mais procurados (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
 

Semelhante a Lecture 27

Pipelining And Vector Processing
Pipelining And Vector ProcessingPipelining And Vector Processing
Pipelining And Vector ProcessingTheInnocentTuber
 
embedded system and computer architecure
embedded system and computer architecureembedded system and computer architecure
embedded system and computer architecuremadhulbtech23
 
PCB_6609.pptx
PCB_6609.pptxPCB_6609.pptx
PCB_6609.pptxTSaiteja2
 
PCB_6609.pptx
PCB_6609.pptxPCB_6609.pptx
PCB_6609.pptxTSaiteja2
 
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.pdfShahdAbdElsamea2
 
System Software module 1
System Software module 1System Software module 1
System Software module 1ShwetaNirmanik
 
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]shibbirtanvin
 
4bit PC report
4bit PC report4bit PC report
4bit PC reporttanvin
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)Mahesh Kumar Attri
 
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.pdfIronMan665214
 
pdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptpdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptSaurabhPorwal14
 
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.pptxAsst.prof M.Gokilavani
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registersmahesh kumar prajapat
 

Semelhante a Lecture 27 (20)

Lecture 21
Lecture 21Lecture 21
Lecture 21
 
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
 
Cs 704 d set2
Cs 704 d set2Cs 704 d set2
Cs 704 d set2
 

Mais de 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
 

Último

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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...Drew Madelung
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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 DevelopmentsTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
[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.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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 textsMaria Levchenko
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Último (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

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