SlideShare a Scribd company logo
1 of 25
The Von Neumann
Architecture
Chapter 04
Computer Science 2210
ABDUL SALAM
COMPUTER TEACHER KARACHI HIGH SCHOOL
The Stored Program Computer
1943: ENIAC
• Presper Eckert and John Mauchly -- first general electronic computer.
(or was it John V. Atanasoff in 1939?)
• Hard-wired program -- settings of dials and switches.
1944: Beginnings of EDVAC
• among other improvements, includes program stored in memory
1945: John von Neumann
• wrote a report on the stored program concept,
known as the First Draft of a Report on EDVAC
The basic structure proposed in the draft became known
as the “von Neumann machine” (or model).
• a memory, containing instructions and data
• a processing unit, for performing arithmetic and logical operations
• a control unit, for interpreting instructions
For more history, see http://www.maxmon.com/history.htm
Von Neumann Model
MEMORY
CONTROL UNIT
MAR MDR
IR
PROCESSING UNIT
ALU TEMP
PC
OUTPUT
Monitor
Printer
LED
Disk
INPUT
Keyboard
Mouse
Scanner
Disk
Memory
2k x m array of stored bits
Address
• unique (k-bit) identifier of location
Contents
• m-bit value stored in location
Basic Operations:
LOAD
• read a value from a memory location
STORE
• write a value to a memory location
•
•
•
0000
0001
0010
0011
0100
0101
0110
1101
1110
1111
00101101
10100010
Interface to Memory
How does processing unit get data to/from memory?
MAR: Memory Address Register
MDR: Memory Data Register
To LOAD a location (A):
1. Write the address (A) into the MAR.
2. Send a “read” signal to the memory.
3. Read the data from MDR.
To STORE a value (X) to a location (A):
1. Write the data (X) to the MDR.
2. Write the address (A) into the MAR.
3. Send a “write” signal to the memory.
M
E
M
O
R
Y
M
A
R M
D
R
Processing Unit
Functional Units
• ALU = Arithmetic and Logic Unit
• could have many functional units.
some of them special-purpose
(multiply, square root, …)
• LC-3 performs ADD, AND, NOT
Registers
• Small, temporary storage
• Operands and results of functional units
• LC-3 has eight registers (R0, …, R7), each 16 bits wide
Word Size
• number of bits normally processed by ALU in one instruction
• also width of registers
• LC-3 is 16 bits
P
R
O
C
E
S
S
I
N
G
U
N
I
T
A
L
U T
E
M
P
Input and Output
Devices for getting data into and out of computer
memory
Each device has its own interface,
usually a set of registers like the
memory’s MAR and MDR
• LC-3 supports keyboard (input) and monitor (output)
• keyboard: data register (KBDR) and status register (KBSR)
• monitor: data register (DDR) and status register (DSR)
Some devices provide both input and output
• disk, network
Program that controls access to a device is
usually called a driver.
INPUT
Keyboard
M ouse
Scanner
Disk
OUTPUT
M onitor
Printer
LED
Disk
Control Unit
Orchestrates execution of the program
Instruction Register (IR) contains the current instruction.
Program Counter (PC) contains the address
of the next instruction to be executed.
Control unit:
• reads an instruction from memory
 the instruction’s address is in the PC
• interprets the instruction, generating signals
that tell the other components what to do
 an instruction may take many machine cycles to complete
CONTROL UNIT
IR
PC
Instruction Processing
Decode instruction
Evaluate address
Fetch operands from memory
Execute operation
Store result
Fetch instruction from memory
Instruction
The instruction is the fundamental unit of work.
Specifies two things:
• opcode: operation to be performed
• operands: data/locations to be used for operation
An instruction is encoded as a sequence of bits.
(Just like data!)
• Often, but not always, instructions have a fixed length,
such as 16 or 32 bits.
• Control unit interprets instruction:
generates sequence of control signals to carry out operation.
• Operation is either executed completely, or not at all.
A computer’s instructions and their formats is known as its
Instruction Set Architecture (ISA).
Example: LC-3 ADD Instruction
LC-3 has 16-bit instructions.
• Each instruction has a four-bit opcode, bits [15:12].
LC-3 has eight registers (R0-R7) for temporary storage.
• Sources and destination of ADD are registers.
“Add the contents of R2 to the contents of R6,
and store the result in R6.”
Example: LC-3 LDR Instruction
Load instruction -- reads data from memory
Base + offset mode:
• add offset to base register -- result is memory address
• load from memory address into destination register
“Add the value 6 to the contents of R3 to form a
memory address. Load the contents of that
memory location to R2.”
Instruction Processing: FETCH
Load next instruction (at address stored in PC)
from memory
into Instruction Register (IR).
• Copy contents of PC into MAR.
• Send “read” signal to memory.
• Copy contents of MDR into IR.
Then increment PC, so that it points to
the next instruction in sequence.
• PC becomes PC+1.
EA
OP
EX
S
F
D
Instruction Processing: DECODE
First identify the opcode.
• In LC-3, this is always the first four bits of instruction.
• A 4-to-16 decoder asserts a control line corresponding
to the desired opcode.
Depending on opcode, identify other operands
from the remaining bits.
• Example:
for LDR, last six bits is offset
for ADD, last three bits is source operand #2
EA
OP
EX
S
F
D
Instruction Processing: EVALUATE ADDRESS
For instructions that require memory access,
compute address used for access.
Examples:
• add offset to base register (as in LDR)
• add offset to PC
• add offset to zero
EA
OP
EX
S
F
D
Instruction Processing: FETCH OPERANDS
Obtain source operands needed to
perform operation.
Examples:
• load data from memory (LDR)
• read data from register file (ADD) EA
OP
EX
S
F
D
Instruction Processing: EXECUTE
Perform the operation,
using the source operands.
Examples:
• send operands to ALU and assert ADD signal
• do nothing (e.g., for loads and stores) EA
OP
EX
S
F
D
Instruction Processing: STORE RESULT
Write results to destination.
(register or memory)
Examples:
• result of ADD is placed in destination register
• result of memory load is placed in destination register
• for store instruction, data is stored to memory
write address to MAR, data to MDR
assert WRITE signal to memory
EA
OP
EX
S
F
D
Changing the Sequence of Instructions
In the FETCH phase,
we increment the Program Counter by 1.
What if we don’t want to always execute the instruction
that follows this one?
• examples: loop, if-then, function call
Need special instructions that change the contents
of the PC.
These are called control instructions.
• jumps are unconditional -- they always change the PC
• branches are conditional -- they change the PC only if
some condition is true (e.g., the result of an ADD is zero)
Example: LC-3 JMP Instruction
Set the PC to the value contained in a register. This
becomes the address of the next instruction to fetch.
“Load the contents of R3 into the PC.”
Instruction Processing Summary
Instructions look just like data -- it’s all interpretation.
Three basic kinds of instructions:
• computational instructions (ADD, AND, …)
• data movement instructions (LD, ST, …)
• control instructions (JMP, BRnz, …)
Six basic phases of instruction processing:
F  D  EA  OP  EX  S
• not all phases are needed by every instruction
• phases may take variable number of machine cycles
Control Unit State Diagram
The control unit is a state machine. Here is part of a
simplified state diagram for the LC-3:
A more complete state diagram is in Appendix C.
It will be more understandable after Chapter 5.
Stopping the Clock
Control unit will repeat instruction processing sequence
as long as clock is running.
• If not processing instructions from your application,
then it is processing instructions from the Operating System (OS).
• The OS is a special program that manages processor
and other resources.
To stop the computer:
• AND the clock generator signal with ZERO
• When control unit stops seeing the CLOCK signal, it stops processing.
Stored Program Concept
 In the stored program concept, both the instructions and the data (that the
instructions operate on) are stored in the computer memory itself. Before the
introduction of this idea, instructions and data were considered two totally
different entities and were thus stored separately.
 Thus instructions like data can be read from the memory and written to the
memory by the processor.
 The processor then addresses the memory, reads the corresponding
instructions, executes them and according to the executed instruction,
processes (reads and writes) data as well.
 Computers that store both instructions and data on the same memory are
said to be based on the Von Neumann architecture. Modern desktop
computers are still based on the same stored program concept.
Summary
Stored Program Computer
• ENIAC
John Von Neumann Model
Memory (Registers)
Processing Unit
Control Unit
Instruction Unit
Fetch-Execute Cycle
Stored Program Concept
25

More Related Content

Similar to ICT-Lecture_12(VonNeumannArchitecture).pptx

Unit-3 Von Neumann Architecture.ppt
Unit-3 Von Neumann Architecture.pptUnit-3 Von Neumann Architecture.ppt
Unit-3 Von Neumann Architecture.pptSatheeswaranV
 
Von neuman architecture
Von neuman architectureVon neuman architecture
Von neuman architecturessuserf06014
 
UNIT 3 - General Purpose Processors
UNIT 3 - General Purpose ProcessorsUNIT 3 - General Purpose Processors
UNIT 3 - General Purpose ProcessorsButtaRajasekhar2
 
Unit 1 computer architecture (1)
Unit 1   computer architecture (1)Unit 1   computer architecture (1)
Unit 1 computer architecture (1)DevaKumari Vijay
 
isa architecture
isa architectureisa architecture
isa architectureAJAL A J
 
module 1 computer architecture diploma
 module 1 computer architecture diploma   module 1 computer architecture diploma
module 1 computer architecture diploma Manoharan Ragavan
 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5Umang Gupta
 
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001SOLOMONCHINAEMEUCHEA
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.CS_GDRCST
 
Basic computer organization and design
Basic computer organization and designBasic computer organization and design
Basic computer organization and designmahesh kumar prajapat
 
Computer Organization and Design.pptx
Computer Organization and Design.pptxComputer Organization and Design.pptx
Computer Organization and Design.pptxSherinRappai
 
Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2parthivrathodlits
 
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...Rai University
 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC  COMPUTER  ORGANIZATION  AND  DESIGNBASIC  COMPUTER  ORGANIZATION  AND  DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGNDr. Ajay Kumar Singh
 
COA CHAPTER 5
COA CHAPTER 5COA CHAPTER 5
COA CHAPTER 5Mori77
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationAmrutaMehata
 

Similar to ICT-Lecture_12(VonNeumannArchitecture).pptx (20)

Unit-3 Von Neumann Architecture.ppt
Unit-3 Von Neumann Architecture.pptUnit-3 Von Neumann Architecture.ppt
Unit-3 Von Neumann Architecture.ppt
 
Von neuman architecture
Von neuman architectureVon neuman architecture
Von neuman architecture
 
UNIT 3 - General Purpose Processors
UNIT 3 - General Purpose ProcessorsUNIT 3 - General Purpose Processors
UNIT 3 - General Purpose Processors
 
Unit 1 computer architecture (1)
Unit 1   computer architecture (1)Unit 1   computer architecture (1)
Unit 1 computer architecture (1)
 
CPU.ppd
CPU.ppdCPU.ppd
CPU.ppd
 
isa architecture
isa architectureisa architecture
isa architecture
 
module 1 computer architecture diploma
 module 1 computer architecture diploma   module 1 computer architecture diploma
module 1 computer architecture diploma
 
Computer arch
Computer archComputer arch
Computer arch
 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5
 
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
 
Basic computer organization and design
Basic computer organization and designBasic computer organization and design
Basic computer organization and design
 
Computer Organization and Design.pptx
Computer Organization and Design.pptxComputer Organization and Design.pptx
Computer Organization and Design.pptx
 
Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
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...
 
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
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organization
 
Intro to cao &store program
Intro to cao &store programIntro to cao &store program
Intro to cao &store program
 

More from SirRafiLectures

AI Lecture-01 (Introduction) NN and Fuzzy
AI Lecture-01 (Introduction) NN and FuzzyAI Lecture-01 (Introduction) NN and Fuzzy
AI Lecture-01 (Introduction) NN and FuzzySirRafiLectures
 
Lecture 08 (SQE, Testing, PM, RM, ME).pptx
Lecture 08 (SQE, Testing, PM, RM, ME).pptxLecture 08 (SQE, Testing, PM, RM, ME).pptx
Lecture 08 (SQE, Testing, PM, RM, ME).pptxSirRafiLectures
 
Lecture 01 (Mean, Median, Mode).pdf
Lecture 01 (Mean, Median, Mode).pdfLecture 01 (Mean, Median, Mode).pdf
Lecture 01 (Mean, Median, Mode).pdfSirRafiLectures
 
ICT-Lecture_08(OperatingSystem).pdf
ICT-Lecture_08(OperatingSystem).pdfICT-Lecture_08(OperatingSystem).pdf
ICT-Lecture_08(OperatingSystem).pdfSirRafiLectures
 
OOP-Lecture-05 (Constructor_Destructor).pptx
OOP-Lecture-05 (Constructor_Destructor).pptxOOP-Lecture-05 (Constructor_Destructor).pptx
OOP-Lecture-05 (Constructor_Destructor).pptxSirRafiLectures
 
Operations Research-Lecture 06B (Graphs).ppt
Operations Research-Lecture 06B (Graphs).pptOperations Research-Lecture 06B (Graphs).ppt
Operations Research-Lecture 06B (Graphs).pptSirRafiLectures
 
Fall_2022 classes Timetable_Rev2.pdf
Fall_2022 classes Timetable_Rev2.pdfFall_2022 classes Timetable_Rev2.pdf
Fall_2022 classes Timetable_Rev2.pdfSirRafiLectures
 

More from SirRafiLectures (7)

AI Lecture-01 (Introduction) NN and Fuzzy
AI Lecture-01 (Introduction) NN and FuzzyAI Lecture-01 (Introduction) NN and Fuzzy
AI Lecture-01 (Introduction) NN and Fuzzy
 
Lecture 08 (SQE, Testing, PM, RM, ME).pptx
Lecture 08 (SQE, Testing, PM, RM, ME).pptxLecture 08 (SQE, Testing, PM, RM, ME).pptx
Lecture 08 (SQE, Testing, PM, RM, ME).pptx
 
Lecture 01 (Mean, Median, Mode).pdf
Lecture 01 (Mean, Median, Mode).pdfLecture 01 (Mean, Median, Mode).pdf
Lecture 01 (Mean, Median, Mode).pdf
 
ICT-Lecture_08(OperatingSystem).pdf
ICT-Lecture_08(OperatingSystem).pdfICT-Lecture_08(OperatingSystem).pdf
ICT-Lecture_08(OperatingSystem).pdf
 
OOP-Lecture-05 (Constructor_Destructor).pptx
OOP-Lecture-05 (Constructor_Destructor).pptxOOP-Lecture-05 (Constructor_Destructor).pptx
OOP-Lecture-05 (Constructor_Destructor).pptx
 
Operations Research-Lecture 06B (Graphs).ppt
Operations Research-Lecture 06B (Graphs).pptOperations Research-Lecture 06B (Graphs).ppt
Operations Research-Lecture 06B (Graphs).ppt
 
Fall_2022 classes Timetable_Rev2.pdf
Fall_2022 classes Timetable_Rev2.pdfFall_2022 classes Timetable_Rev2.pdf
Fall_2022 classes Timetable_Rev2.pdf
 

Recently uploaded

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

ICT-Lecture_12(VonNeumannArchitecture).pptx

  • 1. The Von Neumann Architecture Chapter 04 Computer Science 2210 ABDUL SALAM COMPUTER TEACHER KARACHI HIGH SCHOOL
  • 2. The Stored Program Computer 1943: ENIAC • Presper Eckert and John Mauchly -- first general electronic computer. (or was it John V. Atanasoff in 1939?) • Hard-wired program -- settings of dials and switches. 1944: Beginnings of EDVAC • among other improvements, includes program stored in memory 1945: John von Neumann • wrote a report on the stored program concept, known as the First Draft of a Report on EDVAC The basic structure proposed in the draft became known as the “von Neumann machine” (or model). • a memory, containing instructions and data • a processing unit, for performing arithmetic and logical operations • a control unit, for interpreting instructions For more history, see http://www.maxmon.com/history.htm
  • 3. Von Neumann Model MEMORY CONTROL UNIT MAR MDR IR PROCESSING UNIT ALU TEMP PC OUTPUT Monitor Printer LED Disk INPUT Keyboard Mouse Scanner Disk
  • 4. Memory 2k x m array of stored bits Address • unique (k-bit) identifier of location Contents • m-bit value stored in location Basic Operations: LOAD • read a value from a memory location STORE • write a value to a memory location • • • 0000 0001 0010 0011 0100 0101 0110 1101 1110 1111 00101101 10100010
  • 5. Interface to Memory How does processing unit get data to/from memory? MAR: Memory Address Register MDR: Memory Data Register To LOAD a location (A): 1. Write the address (A) into the MAR. 2. Send a “read” signal to the memory. 3. Read the data from MDR. To STORE a value (X) to a location (A): 1. Write the data (X) to the MDR. 2. Write the address (A) into the MAR. 3. Send a “write” signal to the memory. M E M O R Y M A R M D R
  • 6. Processing Unit Functional Units • ALU = Arithmetic and Logic Unit • could have many functional units. some of them special-purpose (multiply, square root, …) • LC-3 performs ADD, AND, NOT Registers • Small, temporary storage • Operands and results of functional units • LC-3 has eight registers (R0, …, R7), each 16 bits wide Word Size • number of bits normally processed by ALU in one instruction • also width of registers • LC-3 is 16 bits P R O C E S S I N G U N I T A L U T E M P
  • 7. Input and Output Devices for getting data into and out of computer memory Each device has its own interface, usually a set of registers like the memory’s MAR and MDR • LC-3 supports keyboard (input) and monitor (output) • keyboard: data register (KBDR) and status register (KBSR) • monitor: data register (DDR) and status register (DSR) Some devices provide both input and output • disk, network Program that controls access to a device is usually called a driver. INPUT Keyboard M ouse Scanner Disk OUTPUT M onitor Printer LED Disk
  • 8. Control Unit Orchestrates execution of the program Instruction Register (IR) contains the current instruction. Program Counter (PC) contains the address of the next instruction to be executed. Control unit: • reads an instruction from memory  the instruction’s address is in the PC • interprets the instruction, generating signals that tell the other components what to do  an instruction may take many machine cycles to complete CONTROL UNIT IR PC
  • 9. Instruction Processing Decode instruction Evaluate address Fetch operands from memory Execute operation Store result Fetch instruction from memory
  • 10. Instruction The instruction is the fundamental unit of work. Specifies two things: • opcode: operation to be performed • operands: data/locations to be used for operation An instruction is encoded as a sequence of bits. (Just like data!) • Often, but not always, instructions have a fixed length, such as 16 or 32 bits. • Control unit interprets instruction: generates sequence of control signals to carry out operation. • Operation is either executed completely, or not at all. A computer’s instructions and their formats is known as its Instruction Set Architecture (ISA).
  • 11. Example: LC-3 ADD Instruction LC-3 has 16-bit instructions. • Each instruction has a four-bit opcode, bits [15:12]. LC-3 has eight registers (R0-R7) for temporary storage. • Sources and destination of ADD are registers. “Add the contents of R2 to the contents of R6, and store the result in R6.”
  • 12. Example: LC-3 LDR Instruction Load instruction -- reads data from memory Base + offset mode: • add offset to base register -- result is memory address • load from memory address into destination register “Add the value 6 to the contents of R3 to form a memory address. Load the contents of that memory location to R2.”
  • 13. Instruction Processing: FETCH Load next instruction (at address stored in PC) from memory into Instruction Register (IR). • Copy contents of PC into MAR. • Send “read” signal to memory. • Copy contents of MDR into IR. Then increment PC, so that it points to the next instruction in sequence. • PC becomes PC+1. EA OP EX S F D
  • 14. Instruction Processing: DECODE First identify the opcode. • In LC-3, this is always the first four bits of instruction. • A 4-to-16 decoder asserts a control line corresponding to the desired opcode. Depending on opcode, identify other operands from the remaining bits. • Example: for LDR, last six bits is offset for ADD, last three bits is source operand #2 EA OP EX S F D
  • 15. Instruction Processing: EVALUATE ADDRESS For instructions that require memory access, compute address used for access. Examples: • add offset to base register (as in LDR) • add offset to PC • add offset to zero EA OP EX S F D
  • 16. Instruction Processing: FETCH OPERANDS Obtain source operands needed to perform operation. Examples: • load data from memory (LDR) • read data from register file (ADD) EA OP EX S F D
  • 17. Instruction Processing: EXECUTE Perform the operation, using the source operands. Examples: • send operands to ALU and assert ADD signal • do nothing (e.g., for loads and stores) EA OP EX S F D
  • 18. Instruction Processing: STORE RESULT Write results to destination. (register or memory) Examples: • result of ADD is placed in destination register • result of memory load is placed in destination register • for store instruction, data is stored to memory write address to MAR, data to MDR assert WRITE signal to memory EA OP EX S F D
  • 19. Changing the Sequence of Instructions In the FETCH phase, we increment the Program Counter by 1. What if we don’t want to always execute the instruction that follows this one? • examples: loop, if-then, function call Need special instructions that change the contents of the PC. These are called control instructions. • jumps are unconditional -- they always change the PC • branches are conditional -- they change the PC only if some condition is true (e.g., the result of an ADD is zero)
  • 20. Example: LC-3 JMP Instruction Set the PC to the value contained in a register. This becomes the address of the next instruction to fetch. “Load the contents of R3 into the PC.”
  • 21. Instruction Processing Summary Instructions look just like data -- it’s all interpretation. Three basic kinds of instructions: • computational instructions (ADD, AND, …) • data movement instructions (LD, ST, …) • control instructions (JMP, BRnz, …) Six basic phases of instruction processing: F  D  EA  OP  EX  S • not all phases are needed by every instruction • phases may take variable number of machine cycles
  • 22. Control Unit State Diagram The control unit is a state machine. Here is part of a simplified state diagram for the LC-3: A more complete state diagram is in Appendix C. It will be more understandable after Chapter 5.
  • 23. Stopping the Clock Control unit will repeat instruction processing sequence as long as clock is running. • If not processing instructions from your application, then it is processing instructions from the Operating System (OS). • The OS is a special program that manages processor and other resources. To stop the computer: • AND the clock generator signal with ZERO • When control unit stops seeing the CLOCK signal, it stops processing.
  • 24. Stored Program Concept  In the stored program concept, both the instructions and the data (that the instructions operate on) are stored in the computer memory itself. Before the introduction of this idea, instructions and data were considered two totally different entities and were thus stored separately.  Thus instructions like data can be read from the memory and written to the memory by the processor.  The processor then addresses the memory, reads the corresponding instructions, executes them and according to the executed instruction, processes (reads and writes) data as well.  Computers that store both instructions and data on the same memory are said to be based on the Von Neumann architecture. Modern desktop computers are still based on the same stored program concept.
  • 25. Summary Stored Program Computer • ENIAC John Von Neumann Model Memory (Registers) Processing Unit Control Unit Instruction Unit Fetch-Execute Cycle Stored Program Concept 25