SlideShare a Scribd company logo
1 of 11
(a)Suppose the main memory of the Pep/8 were completely
filled with unary instruc- tions. How many instructions would it
contain? (b)What is the maximum number of instructions that
would fit in the main memory if none of the instructions is
unary? (c) Suppose the main memory is completely filled with
an equal number of unary and nonunary instructions. How many
total instructions would it contain?
Solution
The Pep/8 Computer
• Simulated computer system
• Has features in common with many real
architectures
• Illustrates fundamental concepts that apply
to most systems
Pep/8 “hardware” components
• CPU
• Main memory
• I/O devices
• Bus
Pep/8 CPU
• “Electronics” that comprise the Pep/8
instruction set:
– ALU
– Control unit
• Registers: specialized high-speed memory
locations
Main memory
• Aka core memory
• 65,536 8-bit bytes, addressed from 0000
(top address) to FFFF (bottom address)
• Word: specific # of bytes, usual working
storage unit size
– Pep/8 has 16-bit word; this accounts for the
size of most of the registers
– Address of a word is the lower (in value) of
the two bytes
Input devices
• Pep/8 simulates 2:
– Keyboard
– File
• In a particular program, you can use
either, but not both
Output devices
• Same sort of rules as input; 2 supported,
but only one at a time:
– Screen
– Textspecifier
Instructions
• In general, the instruction set is wired into the
CPU:
– Varies among manufacturers
– May also vary within a specific manufacturer’s set of
platforms (e.g. IBM)
• Pep/8 Instruction set
– 32 instructions; 1 or 2-part
– All instructions have a 1-byte instruction specifier; 2-
part instructions have this, plus a 16-bit operand
specifier
Pep/8 Instruction Specifier Format
• Each instruction specifier is composed of:
– 4-bit opcode: determines which instruction will
be executed
– 1-bit register specifier: determines whether
the instruction affects the accumulator (O=A)
or index register (1=X)
– 3-bit addressing mode specifier (ignored if
instruction is unary)
B)
6 registers of the CPU
NZVC, A, X, PC, SP, IR
A
accumumlator, 16 bit
NZVC
status bit, 4 bit
X
index, 16 bit
PC
Program Counter, 16 bit
SP
Stack pointer, 16 bit
IR
Instruction register, 24 bit
Instruction Register
holds an instruction after it has been accessed from memory
X, PC, SP
3 registers that help the CPU access info in main memory
Core memory
another name for main memory
Top of Memory
bytes with small addresses
Bottom of Memory
Bytes with large addresses
2 output devices of pep/8
text file and screen
Solid lines
data flow lines
dashed lines
control lines
39
How many instructions does pep/8 have in its instruction set?
opcode
first part of 8 bit instruction specifier
'a'
can be either a 1 or a 0
machine language
a binary sequence that the CPU interprets according to the
opcodes of its instruction set
direct addressing
The CPU interprets the operand specifier as the address in main
memory of the cell that contains the operand - 001.
Stop Command
0000 0000 , makes the Computer stop
Load instruction
loads one word from a memory location inot accumulator of
index, based on r value
1100 raaa
load instruction
Store instruction
stores one word from either the accumulator or the index
register to a memory location
1110 raaa
store instruction
Add instruction
a word from main meory is added to the content of the register r
0111 raaa
add instruction
Subtract instruction
the operand is subtracted from the register, the result is placed
in register and the operand is unchanged
1000 raaa
subtract instruction
And instruction
Performs a logical operation on the register, useful for masking
out undesired 1 bits from a pattern, affects N & Z
1001 raaa
and instruction
Or instruction
Performs a logical operaton on the register, useful for inserting
1 bits into a bit pattern, affects N & Z
1010 raaa
or instruction
Invert instruction
Performs the NOT operation on the register, affects N & Z
0001 100r
invert instruction
Negate instruction
interprets the register as a signed integer and negates it, affects
N, Z, V bits
0001 101r
negate instruction
byte instructions
operate on a single byte of info instead of a word
Load byte instruction
loads the operand into the right half of either the accumulator or
index, affects N &Z
1101 raaa
load byte instruction
Store byte instruction
stores the right half of either the accumulator or index into a
one byte memory location and doesn't affect any status bits
1111 raaa
store byte instruction
Character input instruction
Takes the next ASCII char from the input device and stores the
corresponding binary code in main memory
0100 1aaa
character input instruction
Character Output instruction
Sends the content of a byte in memory to the output device
0101 0aaa
character output instruction
do loop
aka vonNeumann execution cycle
5 operations of vonNeuman cycle
Fetch, Decode, Increment, Execute, Repeat
0000
What is the lowest hexadecimal address in PEP/8 memory?
FFFF
What is the highest hexadecimal address in PEP/8 memory?
Unary Instruction Specifiers
no operand specifier, example: 0010 0000, 0000 0000
r <--- -r; N <--- r<0, Z <--- r=0, V<---{overflow}
In pep/8 the following RTL specification is for the negate
instruction.
ISA
Instruction Set Architecture
r <--- Oprnd; N <--- r<0, Z <--- r=0
In pep/8 the following RTL specification is for the load
instruction
machine cannot distinguish instructions from data
What is both an advantage and a disadvatnage of the von
Neumann execution cycle?
registers
The pep/8 CPU contains six specialized memory locations
called?
r[8..15]<--- byte Oprnd; N <--- r<0, Z <--- r=0
In pep/8 the following RTL specification is for the load byte
instruction
byte Operand <--- r[8..15]
In pep/8 the following RTL specification is for the store byte
instruction
r <--- -r; N <--- r<0, Z <--- r=0
In pep/8 the following RTL specification is for the invert
instruction
r <--- r / Oprnd; N <--- r<0, Z <--- r=0
In pep/8 the following RTL specification is for the And
instruction
r <--- r / Oprnd; N <--- r<0, Z <--- r=0
In pep/8 the following RTL specification is for the Or
instruction
r <--- r - Oprnd; N <--- r<0, Z <--- r=0, V{overflow}, C{carry}
In pep/8 the following RTL specification is for the Subtract
instruction
r <--- r + Oprnd; N <--- r<0, Z <--- r=0, V{overflow}, C{carry}
In pep/8 the following RTL specification is for the Add
instruction
C)Mnemonic,
modeHexBinaryInstructionLoad/storeLDA,iC0110b r000Load
into AC from immediateLDA,dC1110b r001Load into AC from
memory addressSTA,iE01110 r000[ILLEGAL
INSTRUCTION]STA,dE1111b r001Store from AC into
memoryIf "r" bit is 1, use X(index) register; else
(accumulator)
If "b" bit is 1, one bye only.Arithmetic
instructionsADDA,i700111 r000Add AC + immediate (into
AC)ADDA,d710111 0001Add AC + memory (into
AC)SUBA,i801000 r000Subtract AC - immediate (into
AC)SUBA,d811000 r001Subtract AC - memory (into
AC)Logical instructionsANDA,i901001 r000AND AC +
immediate (into AC)ANDA,d911001 r001AND AC + memory
(into AC)ORA,iA01010 r000OR AC + immediate (into
AC)ORA,dA11010 r001OR AC + memory (into
AC)CPA,iB01011 r000Compare AC with
immediateCPA,dB11011 r001Compare AC with
memoryNOTA180001 100rInvert every bit (1-s
complement)NEGA1A0001 101rNegate the value (2-s
complement)ASLA1C0001 110rArithmetic shift left (with sign
ext.)ASRA1E0001 111rArithmetic shift right (end-
off).ROLA200010 000rRotate leftRORA220010 001rRotate
rightI/O instructionsCHARI,d490100 1001Character input to
memoryCHARO,i500100 1000Character output from
immediateCHARO,d510101 1001Character output from
memoryDECI,d310011 0001Read a decimal number into
memory.DECO,i380011 1000Write a decimal number from
immediate.DECO,d390011 1001Write a decimal number from
memory.STRO400100 0000String output trapBranch
instructionsSTOP000000 0000Stop the computer!BR040000
010xBranch to specified addressBRLE060000 011xBranch if
less-than-or-equalBRLT080000 100xBranch if less-
thanBREQ0A0000 101xBranch if equalBRNE0C0000
110xBranch if not equalBRGE0E0000 111xBranch if greater-or-
equalBRGT000000 000xBranch if greaterBRV020000
001xBranch if overflowBRC040000 010xBranch if
carryCALL060000 011xCall subroutineRETn580101
1nnnReturn from subroutine (with n bytes)If "x" bit is 1, use
X(index) register; else immediate.Stack and other
instructionsADDSP600110 0000Add to stack
pointerSUBSP610110 0001Subtract from stack
pointerMOVSPA020000 0010Move stack pointer to
AMOVFLGA030000 0011Move flags (NZVC) to
ARETTR010000 0001Return from trapNOP2n0010 nnnnUnary
and non-unary no-op trap

More Related Content

Similar to (a)Suppose the main memory of the Pep8 were completely filled with .docx

Microprocessors-based systems (under graduate course) Lecture 7 of 9
Microprocessors-based systems (under graduate course) Lecture 7 of 9 Microprocessors-based systems (under graduate course) Lecture 7 of 9
Microprocessors-based systems (under graduate course) Lecture 7 of 9 Randa Elanwar
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Basil John
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086Waleed Khan
 
12973 block diagram of 8085
12973 block diagram of 808512973 block diagram of 8085
12973 block diagram of 8085RAHULNOUGHTY
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copymkazree
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manualDhaval Shukla
 
Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01cairo university
 
80 c51 family programmer’s guide
80 c51 family programmer’s guide80 c51 family programmer’s guide
80 c51 family programmer’s guidePratheesh Pala
 
The hardware of the Mcs 51 microcontroller
 The hardware of the Mcs 51 microcontroller The hardware of the Mcs 51 microcontroller
The hardware of the Mcs 51 microcontrollerGarba Geidam
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontrollerchirag patil
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontrollerjokersclown57
 

Similar to (a)Suppose the main memory of the Pep8 were completely filled with .docx (20)

Microprocessors-based systems (under graduate course) Lecture 7 of 9
Microprocessors-based systems (under graduate course) Lecture 7 of 9 Microprocessors-based systems (under graduate course) Lecture 7 of 9
Microprocessors-based systems (under graduate course) Lecture 7 of 9
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Unit 4.pptx
Unit 4.pptxUnit 4.pptx
Unit 4.pptx
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
 
module-2.pptx
module-2.pptxmodule-2.pptx
module-2.pptx
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
 
12973 block diagram of 8085
12973 block diagram of 808512973 block diagram of 8085
12973 block diagram of 8085
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copy
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manual
 
8085 instruction-set part 1
8085 instruction-set part 18085 instruction-set part 1
8085 instruction-set part 1
 
Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
8085 instructions
8085 instructions8085 instructions
8085 instructions
 
80 c51 family programmer’s guide
80 c51 family programmer’s guide80 c51 family programmer’s guide
80 c51 family programmer’s guide
 
Lec04
Lec04Lec04
Lec04
 
Lec04
Lec04Lec04
Lec04
 
The hardware of the Mcs 51 microcontroller
 The hardware of the Mcs 51 microcontroller The hardware of the Mcs 51 microcontroller
The hardware of the Mcs 51 microcontroller
 
Architecture of pentium family
Architecture of pentium familyArchitecture of pentium family
Architecture of pentium family
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 

More from ajoy21

Please complete the assignment listed below.Define and explain, us.docx
Please complete the assignment listed below.Define and explain, us.docxPlease complete the assignment listed below.Define and explain, us.docx
Please complete the assignment listed below.Define and explain, us.docxajoy21
 
Please cite sources for each question. Do not use the same sources f.docx
Please cite sources for each question. Do not use the same sources f.docxPlease cite sources for each question. Do not use the same sources f.docx
Please cite sources for each question. Do not use the same sources f.docxajoy21
 
Please choose one of the following questions to answer for this week.docx
Please choose one of the following questions to answer for this week.docxPlease choose one of the following questions to answer for this week.docx
Please choose one of the following questions to answer for this week.docxajoy21
 
Please check the attachment for my paper.Please add citations to a.docx
Please check the attachment for my paper.Please add citations to a.docxPlease check the attachment for my paper.Please add citations to a.docx
Please check the attachment for my paper.Please add citations to a.docxajoy21
 
Please answer to this discussion post. No less than 150 words. Refer.docx
Please answer to this discussion post. No less than 150 words. Refer.docxPlease answer to this discussion post. No less than 150 words. Refer.docx
Please answer to this discussion post. No less than 150 words. Refer.docxajoy21
 
Please attach Non-nursing theorist summaries.JigsawExecutive .docx
Please attach Non-nursing theorist summaries.JigsawExecutive .docxPlease attach Non-nursing theorist summaries.JigsawExecutive .docx
Please attach Non-nursing theorist summaries.JigsawExecutive .docxajoy21
 
Please answer the question .There is no work count. PLEASE NUMBER .docx
Please answer the question .There is no work count. PLEASE NUMBER .docxPlease answer the question .There is no work count. PLEASE NUMBER .docx
Please answer the question .There is no work count. PLEASE NUMBER .docxajoy21
 
Please answer the following questions. Please cite your references..docx
Please answer the following questions. Please cite your references..docxPlease answer the following questions. Please cite your references..docx
Please answer the following questions. Please cite your references..docxajoy21
 
Please answer the following questions.1.      1.  Are you or.docx
Please answer the following questions.1.      1.  Are you or.docxPlease answer the following questions.1.      1.  Are you or.docx
Please answer the following questions.1.      1.  Are you or.docxajoy21
 
Please answer the following question with 200-300 words.Q. Discu.docx
Please answer the following question with 200-300 words.Q. Discu.docxPlease answer the following question with 200-300 words.Q. Discu.docx
Please answer the following question with 200-300 words.Q. Discu.docxajoy21
 
Please answer the following question Why do you think the US ha.docx
Please answer the following question Why do you think the US ha.docxPlease answer the following question Why do you think the US ha.docx
Please answer the following question Why do you think the US ha.docxajoy21
 
Please answer the following questions. Define tunneling in the V.docx
Please answer the following questions. Define tunneling in the V.docxPlease answer the following questions. Define tunneling in the V.docx
Please answer the following questions. Define tunneling in the V.docxajoy21
 
Please answer the following questions1. How can you stimulate the.docx
Please answer the following questions1. How can you stimulate the.docxPlease answer the following questions1. How can you stimulate the.docx
Please answer the following questions1. How can you stimulate the.docxajoy21
 
Please answer the following questions very deeply and presicely .docx
Please answer the following questions very deeply and presicely .docxPlease answer the following questions very deeply and presicely .docx
Please answer the following questions very deeply and presicely .docxajoy21
 
Please answer the following questions in an informal 1 ½ - 2-page es.docx
Please answer the following questions in an informal 1 ½ - 2-page es.docxPlease answer the following questions in an informal 1 ½ - 2-page es.docx
Please answer the following questions in an informal 1 ½ - 2-page es.docxajoy21
 
Please answer the following questions in a response of 150 to 200 wo.docx
Please answer the following questions in a response of 150 to 200 wo.docxPlease answer the following questions in a response of 150 to 200 wo.docx
Please answer the following questions in a response of 150 to 200 wo.docxajoy21
 
Please answer these questions regarding the (TILA) Truth in Lending .docx
Please answer these questions regarding the (TILA) Truth in Lending .docxPlease answer these questions regarding the (TILA) Truth in Lending .docx
Please answer these questions regarding the (TILA) Truth in Lending .docxajoy21
 
Please answer the following question pertaining to psychology. Inc.docx
Please answer the following question pertaining to psychology. Inc.docxPlease answer the following question pertaining to psychology. Inc.docx
Please answer the following question pertaining to psychology. Inc.docxajoy21
 
Please answer the following questions in a response of 250 to 300 .docx
Please answer the following questions in a response of 250 to 300 .docxPlease answer the following questions in a response of 250 to 300 .docx
Please answer the following questions in a response of 250 to 300 .docxajoy21
 
Please answer the three questions completly. I have attached the que.docx
Please answer the three questions completly. I have attached the que.docxPlease answer the three questions completly. I have attached the que.docx
Please answer the three questions completly. I have attached the que.docxajoy21
 

More from ajoy21 (20)

Please complete the assignment listed below.Define and explain, us.docx
Please complete the assignment listed below.Define and explain, us.docxPlease complete the assignment listed below.Define and explain, us.docx
Please complete the assignment listed below.Define and explain, us.docx
 
Please cite sources for each question. Do not use the same sources f.docx
Please cite sources for each question. Do not use the same sources f.docxPlease cite sources for each question. Do not use the same sources f.docx
Please cite sources for each question. Do not use the same sources f.docx
 
Please choose one of the following questions to answer for this week.docx
Please choose one of the following questions to answer for this week.docxPlease choose one of the following questions to answer for this week.docx
Please choose one of the following questions to answer for this week.docx
 
Please check the attachment for my paper.Please add citations to a.docx
Please check the attachment for my paper.Please add citations to a.docxPlease check the attachment for my paper.Please add citations to a.docx
Please check the attachment for my paper.Please add citations to a.docx
 
Please answer to this discussion post. No less than 150 words. Refer.docx
Please answer to this discussion post. No less than 150 words. Refer.docxPlease answer to this discussion post. No less than 150 words. Refer.docx
Please answer to this discussion post. No less than 150 words. Refer.docx
 
Please attach Non-nursing theorist summaries.JigsawExecutive .docx
Please attach Non-nursing theorist summaries.JigsawExecutive .docxPlease attach Non-nursing theorist summaries.JigsawExecutive .docx
Please attach Non-nursing theorist summaries.JigsawExecutive .docx
 
Please answer the question .There is no work count. PLEASE NUMBER .docx
Please answer the question .There is no work count. PLEASE NUMBER .docxPlease answer the question .There is no work count. PLEASE NUMBER .docx
Please answer the question .There is no work count. PLEASE NUMBER .docx
 
Please answer the following questions. Please cite your references..docx
Please answer the following questions. Please cite your references..docxPlease answer the following questions. Please cite your references..docx
Please answer the following questions. Please cite your references..docx
 
Please answer the following questions.1.      1.  Are you or.docx
Please answer the following questions.1.      1.  Are you or.docxPlease answer the following questions.1.      1.  Are you or.docx
Please answer the following questions.1.      1.  Are you or.docx
 
Please answer the following question with 200-300 words.Q. Discu.docx
Please answer the following question with 200-300 words.Q. Discu.docxPlease answer the following question with 200-300 words.Q. Discu.docx
Please answer the following question with 200-300 words.Q. Discu.docx
 
Please answer the following question Why do you think the US ha.docx
Please answer the following question Why do you think the US ha.docxPlease answer the following question Why do you think the US ha.docx
Please answer the following question Why do you think the US ha.docx
 
Please answer the following questions. Define tunneling in the V.docx
Please answer the following questions. Define tunneling in the V.docxPlease answer the following questions. Define tunneling in the V.docx
Please answer the following questions. Define tunneling in the V.docx
 
Please answer the following questions1. How can you stimulate the.docx
Please answer the following questions1. How can you stimulate the.docxPlease answer the following questions1. How can you stimulate the.docx
Please answer the following questions1. How can you stimulate the.docx
 
Please answer the following questions very deeply and presicely .docx
Please answer the following questions very deeply and presicely .docxPlease answer the following questions very deeply and presicely .docx
Please answer the following questions very deeply and presicely .docx
 
Please answer the following questions in an informal 1 ½ - 2-page es.docx
Please answer the following questions in an informal 1 ½ - 2-page es.docxPlease answer the following questions in an informal 1 ½ - 2-page es.docx
Please answer the following questions in an informal 1 ½ - 2-page es.docx
 
Please answer the following questions in a response of 150 to 200 wo.docx
Please answer the following questions in a response of 150 to 200 wo.docxPlease answer the following questions in a response of 150 to 200 wo.docx
Please answer the following questions in a response of 150 to 200 wo.docx
 
Please answer these questions regarding the (TILA) Truth in Lending .docx
Please answer these questions regarding the (TILA) Truth in Lending .docxPlease answer these questions regarding the (TILA) Truth in Lending .docx
Please answer these questions regarding the (TILA) Truth in Lending .docx
 
Please answer the following question pertaining to psychology. Inc.docx
Please answer the following question pertaining to psychology. Inc.docxPlease answer the following question pertaining to psychology. Inc.docx
Please answer the following question pertaining to psychology. Inc.docx
 
Please answer the following questions in a response of 250 to 300 .docx
Please answer the following questions in a response of 250 to 300 .docxPlease answer the following questions in a response of 250 to 300 .docx
Please answer the following questions in a response of 250 to 300 .docx
 
Please answer the three questions completly. I have attached the que.docx
Please answer the three questions completly. I have attached the que.docxPlease answer the three questions completly. I have attached the que.docx
Please answer the three questions completly. I have attached the que.docx
 

Recently uploaded

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of PlayPooky Knightsmith
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 

Recently uploaded (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 

(a)Suppose the main memory of the Pep8 were completely filled with .docx

  • 1. (a)Suppose the main memory of the Pep/8 were completely filled with unary instruc- tions. How many instructions would it contain? (b)What is the maximum number of instructions that would fit in the main memory if none of the instructions is unary? (c) Suppose the main memory is completely filled with an equal number of unary and nonunary instructions. How many total instructions would it contain? Solution The Pep/8 Computer • Simulated computer system • Has features in common with many real architectures • Illustrates fundamental concepts that apply to most systems Pep/8 “hardware” components • CPU • Main memory • I/O devices • Bus Pep/8 CPU • “Electronics” that comprise the Pep/8 instruction set:
  • 2. – ALU – Control unit • Registers: specialized high-speed memory locations Main memory • Aka core memory • 65,536 8-bit bytes, addressed from 0000 (top address) to FFFF (bottom address) • Word: specific # of bytes, usual working storage unit size – Pep/8 has 16-bit word; this accounts for the size of most of the registers – Address of a word is the lower (in value) of the two bytes Input devices • Pep/8 simulates 2: – Keyboard – File • In a particular program, you can use either, but not both Output devices • Same sort of rules as input; 2 supported, but only one at a time: – Screen – Textspecifier
  • 3. Instructions • In general, the instruction set is wired into the CPU: – Varies among manufacturers – May also vary within a specific manufacturer’s set of platforms (e.g. IBM) • Pep/8 Instruction set – 32 instructions; 1 or 2-part – All instructions have a 1-byte instruction specifier; 2- part instructions have this, plus a 16-bit operand specifier Pep/8 Instruction Specifier Format • Each instruction specifier is composed of: – 4-bit opcode: determines which instruction will be executed – 1-bit register specifier: determines whether the instruction affects the accumulator (O=A) or index register (1=X) – 3-bit addressing mode specifier (ignored if instruction is unary) B) 6 registers of the CPU NZVC, A, X, PC, SP, IR A accumumlator, 16 bit
  • 4. NZVC status bit, 4 bit X index, 16 bit PC Program Counter, 16 bit SP Stack pointer, 16 bit IR Instruction register, 24 bit Instruction Register holds an instruction after it has been accessed from memory X, PC, SP 3 registers that help the CPU access info in main memory Core memory another name for main memory Top of Memory bytes with small addresses Bottom of Memory Bytes with large addresses 2 output devices of pep/8 text file and screen Solid lines data flow lines dashed lines
  • 5. control lines 39 How many instructions does pep/8 have in its instruction set? opcode first part of 8 bit instruction specifier 'a' can be either a 1 or a 0 machine language a binary sequence that the CPU interprets according to the opcodes of its instruction set direct addressing The CPU interprets the operand specifier as the address in main memory of the cell that contains the operand - 001. Stop Command 0000 0000 , makes the Computer stop Load instruction loads one word from a memory location inot accumulator of index, based on r value 1100 raaa load instruction Store instruction stores one word from either the accumulator or the index register to a memory location 1110 raaa store instruction
  • 6. Add instruction a word from main meory is added to the content of the register r 0111 raaa add instruction Subtract instruction the operand is subtracted from the register, the result is placed in register and the operand is unchanged 1000 raaa subtract instruction And instruction Performs a logical operation on the register, useful for masking out undesired 1 bits from a pattern, affects N & Z 1001 raaa and instruction Or instruction Performs a logical operaton on the register, useful for inserting 1 bits into a bit pattern, affects N & Z 1010 raaa or instruction Invert instruction Performs the NOT operation on the register, affects N & Z 0001 100r invert instruction Negate instruction interprets the register as a signed integer and negates it, affects
  • 7. N, Z, V bits 0001 101r negate instruction byte instructions operate on a single byte of info instead of a word Load byte instruction loads the operand into the right half of either the accumulator or index, affects N &Z 1101 raaa load byte instruction Store byte instruction stores the right half of either the accumulator or index into a one byte memory location and doesn't affect any status bits 1111 raaa store byte instruction Character input instruction Takes the next ASCII char from the input device and stores the corresponding binary code in main memory 0100 1aaa character input instruction Character Output instruction Sends the content of a byte in memory to the output device 0101 0aaa character output instruction do loop
  • 8. aka vonNeumann execution cycle 5 operations of vonNeuman cycle Fetch, Decode, Increment, Execute, Repeat 0000 What is the lowest hexadecimal address in PEP/8 memory? FFFF What is the highest hexadecimal address in PEP/8 memory? Unary Instruction Specifiers no operand specifier, example: 0010 0000, 0000 0000 r <--- -r; N <--- r<0, Z <--- r=0, V<---{overflow} In pep/8 the following RTL specification is for the negate instruction. ISA Instruction Set Architecture r <--- Oprnd; N <--- r<0, Z <--- r=0 In pep/8 the following RTL specification is for the load instruction machine cannot distinguish instructions from data What is both an advantage and a disadvatnage of the von Neumann execution cycle? registers The pep/8 CPU contains six specialized memory locations called? r[8..15]<--- byte Oprnd; N <--- r<0, Z <--- r=0 In pep/8 the following RTL specification is for the load byte
  • 9. instruction byte Operand <--- r[8..15] In pep/8 the following RTL specification is for the store byte instruction r <--- -r; N <--- r<0, Z <--- r=0 In pep/8 the following RTL specification is for the invert instruction r <--- r / Oprnd; N <--- r<0, Z <--- r=0 In pep/8 the following RTL specification is for the And instruction r <--- r / Oprnd; N <--- r<0, Z <--- r=0 In pep/8 the following RTL specification is for the Or instruction r <--- r - Oprnd; N <--- r<0, Z <--- r=0, V{overflow}, C{carry} In pep/8 the following RTL specification is for the Subtract instruction r <--- r + Oprnd; N <--- r<0, Z <--- r=0, V{overflow}, C{carry} In pep/8 the following RTL specification is for the Add instruction C)Mnemonic, modeHexBinaryInstructionLoad/storeLDA,iC0110b r000Load into AC from immediateLDA,dC1110b r001Load into AC from memory addressSTA,iE01110 r000[ILLEGAL INSTRUCTION]STA,dE1111b r001Store from AC into memoryIf "r" bit is 1, use X(index) register; else
  • 10. (accumulator) If "b" bit is 1, one bye only.Arithmetic instructionsADDA,i700111 r000Add AC + immediate (into AC)ADDA,d710111 0001Add AC + memory (into AC)SUBA,i801000 r000Subtract AC - immediate (into AC)SUBA,d811000 r001Subtract AC - memory (into AC)Logical instructionsANDA,i901001 r000AND AC + immediate (into AC)ANDA,d911001 r001AND AC + memory (into AC)ORA,iA01010 r000OR AC + immediate (into AC)ORA,dA11010 r001OR AC + memory (into AC)CPA,iB01011 r000Compare AC with immediateCPA,dB11011 r001Compare AC with memoryNOTA180001 100rInvert every bit (1-s complement)NEGA1A0001 101rNegate the value (2-s complement)ASLA1C0001 110rArithmetic shift left (with sign ext.)ASRA1E0001 111rArithmetic shift right (end- off).ROLA200010 000rRotate leftRORA220010 001rRotate rightI/O instructionsCHARI,d490100 1001Character input to memoryCHARO,i500100 1000Character output from immediateCHARO,d510101 1001Character output from memoryDECI,d310011 0001Read a decimal number into memory.DECO,i380011 1000Write a decimal number from immediate.DECO,d390011 1001Write a decimal number from memory.STRO400100 0000String output trapBranch instructionsSTOP000000 0000Stop the computer!BR040000
  • 11. 010xBranch to specified addressBRLE060000 011xBranch if less-than-or-equalBRLT080000 100xBranch if less- thanBREQ0A0000 101xBranch if equalBRNE0C0000 110xBranch if not equalBRGE0E0000 111xBranch if greater-or- equalBRGT000000 000xBranch if greaterBRV020000 001xBranch if overflowBRC040000 010xBranch if carryCALL060000 011xCall subroutineRETn580101 1nnnReturn from subroutine (with n bytes)If "x" bit is 1, use X(index) register; else immediate.Stack and other instructionsADDSP600110 0000Add to stack pointerSUBSP610110 0001Subtract from stack pointerMOVSPA020000 0010Move stack pointer to AMOVFLGA030000 0011Move flags (NZVC) to ARETTR010000 0001Return from trapNOP2n0010 nnnnUnary and non-unary no-op trap