SlideShare une entreprise Scribd logo
1  sur  8
Basic Computer Orgsnization and Design 1 Lecture 18
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Overview
Instruction Codes
 Computer Registers
 Computer Instructions
 Timing and Control
 Instruction Cycle
 Memory Reference Instructions
 Input-Output and Interrupt
 Complete Computer Description
Basic Computer Orgsnization and Design 2 Lecture 18
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Input/Output and Interrupt
Input-Output Configuration
INPR Input register - 8 bits
OUTR Output register - 8 bits
FGI Input flag - 1 bit
FGO Output flag - 1 bit
IEN Interrupt enable - 1 bit
- The terminal sends and receives serial information
- The serial info. from the keyboard is shifted into INPR
- The serial info. for the printer is stored in the OUTR
- INPR and OUTR communicate with the terminal serially and with the AC
in parallel.
- The flags are needed to synchronize the timing difference between I/O
device and the computer
A Terminal with a keyboard and a Printer
Input-output
terminal
Serial
communication
interface
Computer
registers and
flip-flops
Printer
Keyboard
Receiver
interface
Transmitter
interface
FGOOUTR
AC
INPR FGI
Serial Communications Path
Parallel Communications Path
Basic Computer Orgsnization and Design 3 Lecture 18
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Programmed Controlled Data Transfer
loop: If FGI = 1 goto loop
INPR  new data, FGI  1
loop: If FGO = 1 goto loop
consume OUTR, FGO  1
-- CPU -- -- I/O Device --
/* Input */ /* Initially FGI = 0 */
loop: If FGI = 0 goto loop
AC  INPR, FGI  0
/* Output */ /* Initially FGO = 1 */
loop: If FGO = 0 goto loop
OUTR  AC, FGO  0
Start Input
FGI  0
FGI=0
AC  INPR
More
Character
END
Start Output
FGO  0
FGO=0
More
Character
OUTR  AC
AC  Data
yes
no
yes
no
FGI=0 FGO=1
yes
yes
no
no
Basic Computer Orgsnization and Design 4 Lecture 18
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Input/Output Instructions
D7IT3 = p
IR(i) = Bi, i = 6, …, 11
p: SC  0 Clear SC
INP pB11: AC(0-7)  INPR, FGI  0 Input char. to AC
OUT pB10: OUTR  AC(0-7), FGO  0 Output char. from AC
SKI pB9: if(FGI = 1) then (PC  PC + 1) Skip on input flag
SKO pB8: if(FGO = 1) then (PC  PC + 1) Skip on output flag
ION pB7: IEN  1 Interrupt enable on
IOF pB6: IEN  0 Interrupt enable off
Basic Computer Orgsnization and Design 5 Lecture 18
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Program controlled Input/Output
• Program-controlled I/O
- Continuous CPU involvement
I/O takes valuable CPU time
- CPU slowed down to I/O speed
- Simple
- Least hardware
Input
LOOP, SKI DEV
BUN LOOP
INP DEV
Output
LOOP, LDA DATA
LOP, SKO DEV
BUN LOP
OUT DEV
Basic Computer Orgsnization and Design 6 Lecture 18
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Interrupt Initiated Input/Output
- Open communication only when some data has to be passed --> interrupt.
- The I/O interface, instead of the CPU, monitors the I/O device.
- When the interface founds that the I/O device is ready for data transfer,
it generates an interrupt request to the CPU
- Upon detecting an interrupt, the CPU stops momentarily the task
it is doing, branches to the service routine to process the data
transfer, and then returns to the task it was performing.
IEN (Interrupt-enable flip-flop)
- can be set and cleared by instructions
- when cleared, the computer cannot be interrupted
Basic Computer Orgsnization and Design 7 Lecture 18
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Flow Chart of Interrupt Cycle
R = Interrupt f/f
- The interrupt cycle is a HW implementation of a branch and save return address
operation.
- At the beginning of the next instruction cycle, the instruction that is read from
memory is in address 1.
- At memory address 1, the programmer must store a branch instruction that sends
the control to an interrupt service routine
- The instruction that returns the control to the original program is "indirect BUN 0"
Store return address
R
=1=0
in location 0
M[0]  PC
Branch to location 1
PC  1
IEN  0
R  0
Interrupt cycleInstruction cycle
Fetch and decode
instructions
IEN
FGI
FGO
Execute
instructions
R  1
=1
=1
=1
=0
=0
=0
Basic Computer Orgsnization and Design 8 Lecture 18
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Register Transfer Operations in Interrupt Cycle
Register Transfer Statements for Interrupt Cycle
- R F/F  1 if IEN (FGI + FGO)T0T1T2
 T0T1T2 (IEN)(FGI + FGO): R  1
- The fetch and decode phases of the instruction cycle
must be modified Replace T0, T1, T2 with R'T0, R'T1, R'T2
- The interrupt cycle :
RT0: AR  0, TR  PC
RT1: M[AR]  TR, PC  0
RT2: PC  PC + 1, IEN  0, R  0, SC  0
After interrupt cycle
0 BUN 1120
0
1
PC = 256
255
1 BUN 0
Before interrupt
Main
Program
1120
I/O
Program
0 BUN 1120
0
PC = 1
256
255
1 BUN 0
Memory
Main
Program
1120
I/O
Program
256

Contenu connexe

Tendances

Computer organization & architecture chapter-1
Computer organization & architecture chapter-1Computer organization & architecture chapter-1
Computer organization & architecture chapter-1
Shah Rukh Rayaz
 
Computer Fundamentals_Chapter 02 bco
Computer Fundamentals_Chapter 02 bcoComputer Fundamentals_Chapter 02 bco
Computer Fundamentals_Chapter 02 bco
Saumya Sahu
 

Tendances (20)

Lecture 19
Lecture 19Lecture 19
Lecture 19
 
Basic computer organisation design
Basic computer organisation designBasic computer organisation design
Basic computer organisation design
 
Basic computer organization and design
Basic computer organization and designBasic computer organization and design
Basic computer organization and design
 
Basic computer organization
Basic computer organizationBasic computer organization
Basic computer organization
 
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
COMPUTER INSTRUCTIONS & TIMING & CONTROL.COMPUTER INSTRUCTIONS & TIMING & CONTROL.
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
 
Computer organization & architecture chapter-1
Computer organization & architecture chapter-1Computer organization & architecture chapter-1
Computer organization & architecture chapter-1
 
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
 
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...
 
Parallel processing and pipelining
Parallel processing and pipeliningParallel processing and pipelining
Parallel processing and pipelining
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Computer Architecture – An Introduction
Computer Architecture – An IntroductionComputer Architecture – An Introduction
Computer Architecture – An Introduction
 
Computer instruction
Computer instructionComputer instruction
Computer instruction
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Lecture 38
Lecture 38Lecture 38
Lecture 38
 
Computer Fundamentals_Chapter 02 bco
Computer Fundamentals_Chapter 02 bcoComputer Fundamentals_Chapter 02 bco
Computer Fundamentals_Chapter 02 bco
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Timing and control
Timing and controlTiming and control
Timing and control
 
Basic Computer Organization and Design
Basic Computer Organization and DesignBasic Computer Organization and Design
Basic Computer Organization and Design
 

Similaire à Lecture 18

Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5
Umang Gupta
 

Similaire à Lecture 18 (20)

input
inputinput
input
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
 
unit2 (1).ppt
unit2 (1).pptunit2 (1).ppt
unit2 (1).ppt
 
Ca basic computer organization
Ca basic computer organizationCa basic computer organization
Ca basic computer organization
 
Memory Reference instruction
Memory Reference instructionMemory Reference instruction
Memory Reference instruction
 
Ch5 official.ppt
Ch5 official.pptCh5 official.ppt
Ch5 official.ppt
 
Unit. 3 coa.ppt
Unit. 3 coa.pptUnit. 3 coa.ppt
Unit. 3 coa.ppt
 
Control unit-implementation
Control unit-implementationControl unit-implementation
Control unit-implementation
 
04_mccormick
04_mccormick04_mccormick
04_mccormick
 
Design of FPGA based 8-bit RISC Controller IP core using VHDL
Design of FPGA based 8-bit RISC Controller IP core using VHDLDesign of FPGA based 8-bit RISC Controller IP core using VHDL
Design of FPGA based 8-bit RISC Controller IP core using VHDL
 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC  COMPUTER  ORGANIZATION  AND  DESIGNBASIC  COMPUTER  ORGANIZATION  AND  DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
 
COA CHAPTER 5
COA CHAPTER 5COA CHAPTER 5
COA CHAPTER 5
 
An cm-303 8-bit-siso_sipo_piso_pipo_shift_registers
An cm-303 8-bit-siso_sipo_piso_pipo_shift_registersAn cm-303 8-bit-siso_sipo_piso_pipo_shift_registers
An cm-303 8-bit-siso_sipo_piso_pipo_shift_registers
 
CAAL_CCSU_U1.pdf
CAAL_CCSU_U1.pdfCAAL_CCSU_U1.pdf
CAAL_CCSU_U1.pdf
 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5
 
Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.k
 
subroutines and interrupts
subroutines and interruptssubroutines and interrupts
subroutines and interrupts
 
BasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss MenoBasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss Meno
 
Microprocessor and Microcontroller Based Systems.ppt
Microprocessor and Microcontroller Based Systems.pptMicroprocessor and Microcontroller Based Systems.ppt
Microprocessor and Microcontroller Based Systems.ppt
 
Processor
Processor Processor
Processor
 

Plus de RahulRathi94 (20)

Lecture 47
Lecture 47Lecture 47
Lecture 47
 
Lecture 46
Lecture 46Lecture 46
Lecture 46
 
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 39
Lecture 39Lecture 39
Lecture 39
 
Lecture 37
Lecture 37Lecture 37
Lecture 37
 
Lecture 36
Lecture 36Lecture 36
Lecture 36
 
Lecture 35
Lecture 35Lecture 35
Lecture 35
 
Lecture 34
Lecture 34Lecture 34
Lecture 34
 
Lecture 28
Lecture 28Lecture 28
Lecture 28
 
Lecture 27
Lecture 27Lecture 27
Lecture 27
 
Lecture 26
Lecture 26Lecture 26
Lecture 26
 
Lecture 25
Lecture 25Lecture 25
Lecture 25
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 
Lecture 22
Lecture 22Lecture 22
Lecture 22
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Lecture 18

  • 1. Basic Computer Orgsnization and Design 1 Lecture 18 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Overview Instruction Codes  Computer Registers  Computer Instructions  Timing and Control  Instruction Cycle  Memory Reference Instructions  Input-Output and Interrupt  Complete Computer Description
  • 2. Basic Computer Orgsnization and Design 2 Lecture 18 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Input/Output and Interrupt Input-Output Configuration INPR Input register - 8 bits OUTR Output register - 8 bits FGI Input flag - 1 bit FGO Output flag - 1 bit IEN Interrupt enable - 1 bit - The terminal sends and receives serial information - The serial info. from the keyboard is shifted into INPR - The serial info. for the printer is stored in the OUTR - INPR and OUTR communicate with the terminal serially and with the AC in parallel. - The flags are needed to synchronize the timing difference between I/O device and the computer A Terminal with a keyboard and a Printer Input-output terminal Serial communication interface Computer registers and flip-flops Printer Keyboard Receiver interface Transmitter interface FGOOUTR AC INPR FGI Serial Communications Path Parallel Communications Path
  • 3. Basic Computer Orgsnization and Design 3 Lecture 18 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Programmed Controlled Data Transfer loop: If FGI = 1 goto loop INPR  new data, FGI  1 loop: If FGO = 1 goto loop consume OUTR, FGO  1 -- CPU -- -- I/O Device -- /* Input */ /* Initially FGI = 0 */ loop: If FGI = 0 goto loop AC  INPR, FGI  0 /* Output */ /* Initially FGO = 1 */ loop: If FGO = 0 goto loop OUTR  AC, FGO  0 Start Input FGI  0 FGI=0 AC  INPR More Character END Start Output FGO  0 FGO=0 More Character OUTR  AC AC  Data yes no yes no FGI=0 FGO=1 yes yes no no
  • 4. Basic Computer Orgsnization and Design 4 Lecture 18 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Input/Output Instructions D7IT3 = p IR(i) = Bi, i = 6, …, 11 p: SC  0 Clear SC INP pB11: AC(0-7)  INPR, FGI  0 Input char. to AC OUT pB10: OUTR  AC(0-7), FGO  0 Output char. from AC SKI pB9: if(FGI = 1) then (PC  PC + 1) Skip on input flag SKO pB8: if(FGO = 1) then (PC  PC + 1) Skip on output flag ION pB7: IEN  1 Interrupt enable on IOF pB6: IEN  0 Interrupt enable off
  • 5. Basic Computer Orgsnization and Design 5 Lecture 18 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Program controlled Input/Output • Program-controlled I/O - Continuous CPU involvement I/O takes valuable CPU time - CPU slowed down to I/O speed - Simple - Least hardware Input LOOP, SKI DEV BUN LOOP INP DEV Output LOOP, LDA DATA LOP, SKO DEV BUN LOP OUT DEV
  • 6. Basic Computer Orgsnization and Design 6 Lecture 18 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Interrupt Initiated Input/Output - Open communication only when some data has to be passed --> interrupt. - The I/O interface, instead of the CPU, monitors the I/O device. - When the interface founds that the I/O device is ready for data transfer, it generates an interrupt request to the CPU - Upon detecting an interrupt, the CPU stops momentarily the task it is doing, branches to the service routine to process the data transfer, and then returns to the task it was performing. IEN (Interrupt-enable flip-flop) - can be set and cleared by instructions - when cleared, the computer cannot be interrupted
  • 7. Basic Computer Orgsnization and Design 7 Lecture 18 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Flow Chart of Interrupt Cycle R = Interrupt f/f - The interrupt cycle is a HW implementation of a branch and save return address operation. - At the beginning of the next instruction cycle, the instruction that is read from memory is in address 1. - At memory address 1, the programmer must store a branch instruction that sends the control to an interrupt service routine - The instruction that returns the control to the original program is "indirect BUN 0" Store return address R =1=0 in location 0 M[0]  PC Branch to location 1 PC  1 IEN  0 R  0 Interrupt cycleInstruction cycle Fetch and decode instructions IEN FGI FGO Execute instructions R  1 =1 =1 =1 =0 =0 =0
  • 8. Basic Computer Orgsnization and Design 8 Lecture 18 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Register Transfer Operations in Interrupt Cycle Register Transfer Statements for Interrupt Cycle - R F/F  1 if IEN (FGI + FGO)T0T1T2  T0T1T2 (IEN)(FGI + FGO): R  1 - The fetch and decode phases of the instruction cycle must be modified Replace T0, T1, T2 with R'T0, R'T1, R'T2 - The interrupt cycle : RT0: AR  0, TR  PC RT1: M[AR]  TR, PC  0 RT2: PC  PC + 1, IEN  0, R  0, SC  0 After interrupt cycle 0 BUN 1120 0 1 PC = 256 255 1 BUN 0 Before interrupt Main Program 1120 I/O Program 0 BUN 1120 0 PC = 1 256 255 1 BUN 0 Memory Main Program 1120 I/O Program 256