SlideShare a Scribd company logo
Programming The Basic Computer
Unit-2
Programming Basic Computer The list of
instructions or statements that directs
the computer hardware to perform specific task is
called a program. There are
many programming languages
but,the computer basically understands programs
that are given in binary (0s, 1s) form
Those concerned with computer architecture should
have a knowledge of both hardware and software
because the two branches influence each other
Instruction Set of the Basic Computer
MACHINE LANGUAGE
 Program
A list of instructions or statements for directing
the computer to perform a required data
processing task
Various types of programming languages
- Hierarchy of programming languages
• Machine-language
- Binary code
- Octal or hexadecimal code
• Assembly-language (Assembler)
- Symbolic code
• High-level language (Compiler)
COMPARISON OF PROGRAMMING
LANGUAGES
ASSEMBLY LANGUAGE
Syntax of the Basic Computer assembly language
Each line is arranged in three columns called
fields
Label field
- May be empty or may specify a symbolic
Address consists of up to 3 characters
- Terminated by a comma
Instruction field
- Specifies a machine or a pseudo instruction
- May specify one of
* Memory reference instr. (MRI)
MRI consists of two or three symbols separated by
spaces.
ADD OPR (direct address MRI)
ADD PTR I (indirect address MRI)
 Register reference or input-output instr.
Non-MRI does not have an address part
* Pseudo instr. with or without an operand
Symbolic address used in the instruction field
must be
defined somewhere as a label
Comment field
- May be empty or may include a comment
TRANSLATION TO BINARY
PROGRAM LOOPS
PROGRAMMING ARITHMETIC AND LOGIC
OPERATIONS
Implementation of Arithmetic and Logic Operations
- Software Implementation
- Implementation of an operation with a program
using machine instruction set
- Usually when the operation is not included
in the instruction set
- Hardware Implementation
- Implementation of an operation in a computer
with one machine instruction
Software Implementation example:
* Multiplication
- For simplicity, unsigned positive numbers
- 8-bit numbers -> 16-bit product
- Logic and Shift Operations -
SUBROUTINES
INPUT OUTPUT PROGRAM
Micro programmed Control
 Hardwired Control Unit: When the control signals
are generated by hardware using conventional logic
design techniques, the control unit is said to be
hardwired.
 Micro programmed control unit: A control unit
whose binary control variables are stored in memory
is called a micro programmed control unit.
 Control Memory: Control Memory is the storage in
the microprogrammed control unit to store the
microprogram.
 Writeable Control Memory: Control Storage whose
contents can be modified, allow the change in
microprogram and Instruction set can be changed or
modified is referred as Writeable Control Memory.
 Control Word: The control variables at any given
time can be represented by a control word string of 1
's and 0's called a control word.
Micro-operation, Micro-instruction,
Micro program, Microcode
 Microoperations: In computer central processing
units, micro-operations (also known as a micro-
ops or μops) are detailed low-level instructions
used in some designs to implement complex
machine instructions (sometimes termed macro-
instructions in this context).
Micro instruction:
 A symbolic microprogram can be translated into its
binary equivalent by means of an assembler.
 Each line of the assembly language microprogram
defines a symbolic microinstruction.
 Each symbolic microinstruction is divided into five
fields: label, microoperations, CD, BR, and AD
Micro program:
 A sequence of microinstructions constitutes a
microprogram.
 Since alterations of the microprogram are not
needed once the control unit is in operation, the
control memory can be a read-only memory (ROM).
 ROM words are made permanent during the
hardware production of the unit.
 The use of a micro program involves placing all
control variables in words of ROM for use by the
control unit through successive read operations.
 The content of the word in ROM at a given address
specifies a microinstruction.
Microcode:
 Microinstructions can be saved by employing
subroutines that use common sections of microcode.
 For example, the sequence of micro operations
needed to generate the effective address of the
operand for an instruction is common to all memory
reference instructions.
 This sequence could be a subroutine that is called
from within many other routines to execute the
effective address computation.
Organization of micro programmed
control unit
 The general configuration of a micro-
programmed control unit is demonstrated in the
block diagram of Figure
 The control memory is assumed to be a ROM,
within which all control information is
permanently stored.
 The control memory address register specifies the
address of the microinstruction, and the control data
register holds the microinstruction read from
memory.
 The microinstruction contains a control word that
specifies one or more microoperations for the data
processor. Once these operations are executed, the
control must determine the next address.
 The location of the next microinstruction may be the
one next in sequence, or it may be located
somewhere else in the control memory.
 While the microoperations are being executed, the
next address is computed in the next address
generator circuit and then transferred into the control
address register to read the next microinstruction.
 Thus a microinstruction contains bits for initiating
microoperations in the data processor part and bits
that determine the address sequence for the control
memory.
 The next address generator is sometimes called a
micro-program sequencer, as it determines the
address sequence that is read from control memory.
 Typical functions of a micro-program sequencer are
incrementing the control address register by one,
loading into the control address register an address
from control memory,transferring an external
address, or loading an initial address to start the
control operations.
 The control data register holds the present
microinstruction while the next address is computed
and read from memory.
 The data register is sometimes called a pipeline
register.
 It allows the execution of the microoperations
specified by the control word simultaneously with the
generation of the next microinstruction.
 This configuration requires a two-phase clock, with
one clock applied to the address register and the
other to the data register.
 The main advantage of the micro programmed
control is the fact that once the hardware
configuration is established; there should be no need
for further hardware or wiring changes.
 If we want to establish a different control sequence
for the system, all we need to do is specify a
Address Sequencing
Microinstructions are stored in control memory in
groups, with each group specifying a routine.
To appreciate the address sequencing in a micro-
program control unit, let us specify the steps that the
control must undergo during the execution of a single
computer instruction.
Step-1:
 An initial address is loaded into the control address
register when power is turned on in the computer.
 This address is usually the address of the first
microinstruction that activates the instruction fetch
routine.
 The fetch routine may be sequenced by
incrementing the control address register through the
rest of its microinstructions.
 At the end of the fetch routine, the instruction is in
the instruction register of the computer.
Step-2:
 The control memory next must go through the
routine that determines the effective address of the
operand.
 A machine instruction may have bits that specify
various addressing modes, such as indirect address
and index registers.
 The effective address computation routine in control
memory can be reached through a branch
microinstruction, which is conditioned on the status
of the mode bits of the instruction.
 When the effective address computation routine is
completed, the address of the operand is available in
the memory address register.
Step-3:
 The next step is to generate the microoperations
that execute the instruction fetched from memory.
 The microoperation steps to be generated in
processor registers depend on the operation code
part of the instruction.
 Each instruction has its own micro-program routine
stored in a given location of control memory.
 The transformation from the instruction code bits to
an address in control memory where the routine is
located is referred to as a mapping process.
 A mapping procedure is a rule that transforms the
instruction code into a control memory address.
Step-4:
 Once the required routine is reached, the
microinstructions that execute the instruction may be
sequenced by incrementing the control address
register.
 Micro-programs that employ subroutines will require
an external register for storing the return address.
 Return addresses cannot be stored in ROM because
the unit has no writing capability.
 When the execution of the instruction is completed,
control must return to the fetch routine.
 This is accomplished by executing an unconditional
branch microinstruction to the first address of the
fetch routine.
Summary: the address sequencing
capabilities required in a control memory
are:
1. Incrementing of the control address register.
2. Unconditional branch or conditional branch,
depending on status bit conditions.
3. A mapping process from the bits of the instruction to
an address for control memory.
4. A facility for subroutine call and return.
Selection of address for control memory
Above figure shows a block diagram of a control memory and the associated
hardware needed for selecting the next microinstruction address.
 The microinstruction in control memory contains a set of
bits to initiate microoperations in computer registers and
other bits to specify the method by which the next
address is obtained.
 The diagram shows four different paths from which the
control address register (CAR) receives the address.
 The incrementer increments the content of the control
address register by one, to select the next
microinstruction in sequence.
 Branching is achieved by specifying the branch address
in one of the fields of the microinstruction.
 Conditional branching is obtained by using part of the
microinstruction to select a specific status bit in order to
determine its condition.
 An external address is transferred into control memory
via a mapping logic circuit.
 The return address for a subroutine is stored in a special
register whose value is then used when the micro-
program wishes to return from the subroutine.
 The branch logic of figure provides decision-making
capabilities in the control unit.
 The status conditions are special bits in the system
that provide parameter information such as the
carry-out of an adder, the sign bit of a number, the
mode bits of an instruction,and input or output status
conditions.
 The status bits, together with the field in the
microinstruction that specifies a branch address,
control the conditional branch decisions generated in
the branch logic.
 A 1 output in the multiplexer generates a control
signal to transfer the branch address from the
microinstruction into the control address register.
 A 0 output in the multiplexer causes the address
register to be incremented.
Mapping of an Instruction
 A special type of branch exists when a microinstruction specifies a branch to the first
word in control memory where a microprogram routine for an instruction is located.
 The status bits for this type of branch are the bits in the operation code part of the
Instruction.For example, a computer with a simple instruction format as shown in
figure belowhas an operation code of four bits which can specify up to 16 distinct
instructions.
 Assume further that the control memory has 128 words, requiring an address of seven
bits.
 One simple mapping process that converts the 4-bit operation code to a 7-bit address
for
 control memory is shown in figure below.
 This mapping consists of placing a 0 in the most significant bit of the address,
transferring the four operation code bits, and clearing the two least significant bits of
the control address register.
 This provides for each computer instruction a microprogram routine with a capacity of
 four microinstructions.
 If the routine needs more than four microinstructions, it can use addresses 1000000
through 1111111. If it uses fewer than four microinstructions, the unused memory
locations would be available for other routines.
microinstruction
address
•One can extend this concept to a more general mapping rule by using a ROM
to specify the mapping function.
•The contents of the mapping ROM give the bits for the control address
register.
•In this way the microprogram routine that executes the instruction can be
placed in any desired location in control memory.
•The mapping concept provides flexibility for adding instructions for control
memory as the need arises.
 A Hard-wired Control consists of two decoders, a
sequence counter, and a number of logic gates.
 An instruction fetched from the memory unit is placed in
the instruction register (IR).
 The component of an instruction register includes; I bit,
the operation code, and bits 0 through 11.
 The operation code in bits 12 through 14 are coded with
a 3 x 8 decoder.
 The outputs of the decoder are designated by the
symbols D0 through D7.
 The operation code at bit 15 is transferred to a flip-flop
designated by the symbol I.
 The operation codes from Bits 0 through 11 are applied
to the control logic gates.
 The Sequence counter (SC) can count in binary from 0
through 15.
 The Control memory address register specifies the address of the
micro-instruction.
 The Control memory is assumed to be a ROM, within which all
control information is permanently stored.
 The control register holds the microinstruction fetched from the
memory.
 The micro-instruction contains a control word that specifies one or
more micro-operations for the data processor.
 While the micro-operations are being executed, the next address is
computed in the next address generator circuit and then transferred
into the control address register to read the next microinstruction.
 The next address generator is often referred to as a micro-program
sequencer, as it determines the address sequence that is read from
control memory.

More Related Content

What's hot

Chapter 8
Chapter 8Chapter 8
Advanced processor Principles
Advanced processor PrinciplesAdvanced processor Principles
Advanced processor Principles
Vinit Raut
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
Suvendu Kumar Dash
 
16 control unit
16 control unit16 control unit
16 control unit
dilip kumar
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
Sanjeev Patel
 
Chapter 10
Chapter 10Chapter 10
Chapter 4
Chapter 4Chapter 4
Program control
Program controlProgram control
Program control
Rahul Narang
 
COMPUTER ORGANIZATION NOTES Unit 3 4
COMPUTER ORGANIZATION NOTES  Unit 3 4COMPUTER ORGANIZATION NOTES  Unit 3 4
COMPUTER ORGANIZATION NOTES Unit 3 4
Dr.MAYA NAYAK
 
Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
Deepak John
 
Chapter 2
Chapter 2Chapter 2
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...
Rai University
 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5Umang Gupta
 
Computer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationComputer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and Organization
Smit Luvani
 
Chapter 7
Chapter 7Chapter 7
Computer architecture
Computer architectureComputer architecture
Computer architecture
Rama senthilkumar
 
03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.enc03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.enc
Anwal Mirza
 
Instruction set and instruction execution cycle
Instruction set and instruction execution cycleInstruction set and instruction execution cycle
Instruction set and instruction execution cycle
Mkaur01
 

What's hot (20)

Chapter 8
Chapter 8Chapter 8
Chapter 8
 
Advanced processor Principles
Advanced processor PrinciplesAdvanced processor Principles
Advanced processor Principles
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 
16 control unit
16 control unit16 control unit
16 control unit
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Unit3 input
Unit3 inputUnit3 input
Unit3 input
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Program control
Program controlProgram control
Program control
 
COMPUTER ORGANIZATION NOTES Unit 3 4
COMPUTER ORGANIZATION NOTES  Unit 3 4COMPUTER ORGANIZATION NOTES  Unit 3 4
COMPUTER ORGANIZATION NOTES Unit 3 4
 
Lecture 39
Lecture 39Lecture 39
Lecture 39
 
Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
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...
 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5
 
Computer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationComputer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and Organization
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.enc03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.enc
 
Instruction set and instruction execution cycle
Instruction set and instruction execution cycleInstruction set and instruction execution cycle
Instruction set and instruction execution cycle
 

Similar to Unit 2

unit-3.pdf
unit-3.pdfunit-3.pdf
unit-3.pdf
Saurabh846965
 
chapter3_CA.pptt nnnnnnnnnnnnnnnnnnnnnnn
chapter3_CA.pptt nnnnnnnnnnnnnnnnnnnnnnnchapter3_CA.pptt nnnnnnnnnnnnnnnnnnnnnnn
chapter3_CA.pptt nnnnnnnnnnnnnnnnnnnnnnn
NineTo1
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
PreethiSureshkumar1
 
CS304PC:Computer Organization and Architecture UNIT II .pdf
CS304PC:Computer Organization and Architecture UNIT II .pdfCS304PC:Computer Organization and Architecture UNIT II .pdf
CS304PC:Computer Organization and Architecture UNIT II .pdf
Asst.prof M.Gokilavani
 
COMPUTER SYSTEM ARCHITECTURE UNIT 3 FULL SLIDES
COMPUTER SYSTEM ARCHITECTURE UNIT 3 FULL SLIDESCOMPUTER SYSTEM ARCHITECTURE UNIT 3 FULL SLIDES
COMPUTER SYSTEM ARCHITECTURE UNIT 3 FULL SLIDES
ShahidSultan24
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unit
abdosaidgkv
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
janani thirupathi
 
Datatransferandmanipulation 180214044522
Datatransferandmanipulation 180214044522Datatransferandmanipulation 180214044522
Datatransferandmanipulation 180214044522
kirupasuchi1996
 
Unit 3 CO.pptx
Unit 3 CO.pptxUnit 3 CO.pptx
Unit 3 CO.pptx
NeerajaBhukya
 
Control Memory.pptx
Control Memory.pptxControl Memory.pptx
CS304PC:Computer Organization and Architecture Session 7 Microprogrammed con...
CS304PC:Computer Organization and Architecture  Session 7 Microprogrammed con...CS304PC:Computer Organization and Architecture  Session 7 Microprogrammed con...
CS304PC:Computer Organization and Architecture Session 7 Microprogrammed con...
Asst.prof M.Gokilavani
 
conrol_Unit_part_of_computer_architecture.pptx
conrol_Unit_part_of_computer_architecture.pptxconrol_Unit_part_of_computer_architecture.pptx
conrol_Unit_part_of_computer_architecture.pptx
jbri1395
 
Micro programmed control
Micro programmed  controlMicro programmed  control
Micro programmed control
Shashank Singh
 
CO Unit 3.pdf (Important chapter of coa)
CO Unit 3.pdf (Important chapter of coa)CO Unit 3.pdf (Important chapter of coa)
CO Unit 3.pdf (Important chapter of coa)
guptakrishns23
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
Saranya1702
 
Addressing sequencing
Addressing sequencingAddressing sequencing
Addressing sequencing
rajshreemuthiah
 
Introduction to Microcontrollers
Introduction to MicrocontrollersIntroduction to Microcontrollers
Introduction to Microcontrollers
SaravananVijayakumar4
 
CSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptxCSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptx
sukhpreetsingh295239
 
16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)
Susam Pal
 

Similar to Unit 2 (20)

unit-3.pdf
unit-3.pdfunit-3.pdf
unit-3.pdf
 
chapter3_CA.pptt nnnnnnnnnnnnnnnnnnnnnnn
chapter3_CA.pptt nnnnnnnnnnnnnnnnnnnnnnnchapter3_CA.pptt nnnnnnnnnnnnnnnnnnnnnnn
chapter3_CA.pptt nnnnnnnnnnnnnnnnnnnnnnn
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
CS304PC:Computer Organization and Architecture UNIT II .pdf
CS304PC:Computer Organization and Architecture UNIT II .pdfCS304PC:Computer Organization and Architecture UNIT II .pdf
CS304PC:Computer Organization and Architecture UNIT II .pdf
 
COMPUTER SYSTEM ARCHITECTURE UNIT 3 FULL SLIDES
COMPUTER SYSTEM ARCHITECTURE UNIT 3 FULL SLIDESCOMPUTER SYSTEM ARCHITECTURE UNIT 3 FULL SLIDES
COMPUTER SYSTEM ARCHITECTURE UNIT 3 FULL SLIDES
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unit
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Datatransferandmanipulation 180214044522
Datatransferandmanipulation 180214044522Datatransferandmanipulation 180214044522
Datatransferandmanipulation 180214044522
 
Unit 3 CO.pptx
Unit 3 CO.pptxUnit 3 CO.pptx
Unit 3 CO.pptx
 
Control Memory.pptx
Control Memory.pptxControl Memory.pptx
Control Memory.pptx
 
CS304PC:Computer Organization and Architecture Session 7 Microprogrammed con...
CS304PC:Computer Organization and Architecture  Session 7 Microprogrammed con...CS304PC:Computer Organization and Architecture  Session 7 Microprogrammed con...
CS304PC:Computer Organization and Architecture Session 7 Microprogrammed con...
 
conrol_Unit_part_of_computer_architecture.pptx
conrol_Unit_part_of_computer_architecture.pptxconrol_Unit_part_of_computer_architecture.pptx
conrol_Unit_part_of_computer_architecture.pptx
 
Micro programmed control
Micro programmed  controlMicro programmed  control
Micro programmed control
 
CO Unit 3.pdf (Important chapter of coa)
CO Unit 3.pdf (Important chapter of coa)CO Unit 3.pdf (Important chapter of coa)
CO Unit 3.pdf (Important chapter of coa)
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
 
Addressing sequencing
Addressing sequencingAddressing sequencing
Addressing sequencing
 
Introduction to Microcontrollers
Introduction to MicrocontrollersIntroduction to Microcontrollers
Introduction to Microcontrollers
 
CSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptxCSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptx
 
2.computer org.
2.computer org.2.computer org.
2.computer org.
 
16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)
 

More from vishal choudhary

SE-Lecture1.ppt
SE-Lecture1.pptSE-Lecture1.ppt
SE-Lecture1.ppt
vishal choudhary
 
SE-Testing.ppt
SE-Testing.pptSE-Testing.ppt
SE-Testing.ppt
vishal choudhary
 
SE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.pptSE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.ppt
vishal choudhary
 
SE-Lecture-7.pptx
SE-Lecture-7.pptxSE-Lecture-7.pptx
SE-Lecture-7.pptx
vishal choudhary
 
Se-Lecture-6.ppt
Se-Lecture-6.pptSe-Lecture-6.ppt
Se-Lecture-6.ppt
vishal choudhary
 
SE-Lecture-5.pptx
SE-Lecture-5.pptxSE-Lecture-5.pptx
SE-Lecture-5.pptx
vishal choudhary
 
SE-Lecture-8.pptx
SE-Lecture-8.pptxSE-Lecture-8.pptx
SE-Lecture-8.pptx
vishal choudhary
 
SE-coupling and cohesion.ppt
SE-coupling and cohesion.pptSE-coupling and cohesion.ppt
SE-coupling and cohesion.ppt
vishal choudhary
 
SE-Lecture-2.pptx
SE-Lecture-2.pptxSE-Lecture-2.pptx
SE-Lecture-2.pptx
vishal choudhary
 
SE-software design.ppt
SE-software design.pptSE-software design.ppt
SE-software design.ppt
vishal choudhary
 
SE1.ppt
SE1.pptSE1.ppt
SE-Lecture-4.pptx
SE-Lecture-4.pptxSE-Lecture-4.pptx
SE-Lecture-4.pptx
vishal choudhary
 
SE-Lecture=3.pptx
SE-Lecture=3.pptxSE-Lecture=3.pptx
SE-Lecture=3.pptx
vishal choudhary
 
Multimedia-Lecture-Animation.pptx
Multimedia-Lecture-Animation.pptxMultimedia-Lecture-Animation.pptx
Multimedia-Lecture-Animation.pptx
vishal choudhary
 
MultimediaLecture5.pptx
MultimediaLecture5.pptxMultimediaLecture5.pptx
MultimediaLecture5.pptx
vishal choudhary
 
Multimedia-Lecture-7.pptx
Multimedia-Lecture-7.pptxMultimedia-Lecture-7.pptx
Multimedia-Lecture-7.pptx
vishal choudhary
 
MultiMedia-Lecture-4.pptx
MultiMedia-Lecture-4.pptxMultiMedia-Lecture-4.pptx
MultiMedia-Lecture-4.pptx
vishal choudhary
 
Multimedia-Lecture-6.pptx
Multimedia-Lecture-6.pptxMultimedia-Lecture-6.pptx
Multimedia-Lecture-6.pptx
vishal choudhary
 
Multimedia-Lecture-3.pptx
Multimedia-Lecture-3.pptxMultimedia-Lecture-3.pptx
Multimedia-Lecture-3.pptx
vishal choudhary
 

More from vishal choudhary (20)

SE-Lecture1.ppt
SE-Lecture1.pptSE-Lecture1.ppt
SE-Lecture1.ppt
 
SE-Testing.ppt
SE-Testing.pptSE-Testing.ppt
SE-Testing.ppt
 
SE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.pptSE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.ppt
 
SE-Lecture-7.pptx
SE-Lecture-7.pptxSE-Lecture-7.pptx
SE-Lecture-7.pptx
 
Se-Lecture-6.ppt
Se-Lecture-6.pptSe-Lecture-6.ppt
Se-Lecture-6.ppt
 
SE-Lecture-5.pptx
SE-Lecture-5.pptxSE-Lecture-5.pptx
SE-Lecture-5.pptx
 
XML.pptx
XML.pptxXML.pptx
XML.pptx
 
SE-Lecture-8.pptx
SE-Lecture-8.pptxSE-Lecture-8.pptx
SE-Lecture-8.pptx
 
SE-coupling and cohesion.ppt
SE-coupling and cohesion.pptSE-coupling and cohesion.ppt
SE-coupling and cohesion.ppt
 
SE-Lecture-2.pptx
SE-Lecture-2.pptxSE-Lecture-2.pptx
SE-Lecture-2.pptx
 
SE-software design.ppt
SE-software design.pptSE-software design.ppt
SE-software design.ppt
 
SE1.ppt
SE1.pptSE1.ppt
SE1.ppt
 
SE-Lecture-4.pptx
SE-Lecture-4.pptxSE-Lecture-4.pptx
SE-Lecture-4.pptx
 
SE-Lecture=3.pptx
SE-Lecture=3.pptxSE-Lecture=3.pptx
SE-Lecture=3.pptx
 
Multimedia-Lecture-Animation.pptx
Multimedia-Lecture-Animation.pptxMultimedia-Lecture-Animation.pptx
Multimedia-Lecture-Animation.pptx
 
MultimediaLecture5.pptx
MultimediaLecture5.pptxMultimediaLecture5.pptx
MultimediaLecture5.pptx
 
Multimedia-Lecture-7.pptx
Multimedia-Lecture-7.pptxMultimedia-Lecture-7.pptx
Multimedia-Lecture-7.pptx
 
MultiMedia-Lecture-4.pptx
MultiMedia-Lecture-4.pptxMultiMedia-Lecture-4.pptx
MultiMedia-Lecture-4.pptx
 
Multimedia-Lecture-6.pptx
Multimedia-Lecture-6.pptxMultimedia-Lecture-6.pptx
Multimedia-Lecture-6.pptx
 
Multimedia-Lecture-3.pptx
Multimedia-Lecture-3.pptxMultimedia-Lecture-3.pptx
Multimedia-Lecture-3.pptx
 

Recently uploaded

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 

Recently uploaded (20)

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 

Unit 2

  • 1. Programming The Basic Computer Unit-2
  • 2. Programming Basic Computer The list of instructions or statements that directs the computer hardware to perform specific task is called a program. There are many programming languages but,the computer basically understands programs that are given in binary (0s, 1s) form
  • 3. Those concerned with computer architecture should have a knowledge of both hardware and software because the two branches influence each other
  • 4. Instruction Set of the Basic Computer
  • 5. MACHINE LANGUAGE  Program A list of instructions or statements for directing the computer to perform a required data processing task Various types of programming languages - Hierarchy of programming languages • Machine-language - Binary code - Octal or hexadecimal code • Assembly-language (Assembler) - Symbolic code • High-level language (Compiler)
  • 7. ASSEMBLY LANGUAGE Syntax of the Basic Computer assembly language Each line is arranged in three columns called fields Label field - May be empty or may specify a symbolic Address consists of up to 3 characters - Terminated by a comma
  • 8. Instruction field - Specifies a machine or a pseudo instruction - May specify one of * Memory reference instr. (MRI) MRI consists of two or three symbols separated by spaces. ADD OPR (direct address MRI) ADD PTR I (indirect address MRI)
  • 9.  Register reference or input-output instr. Non-MRI does not have an address part * Pseudo instr. with or without an operand Symbolic address used in the instruction field must be defined somewhere as a label Comment field - May be empty or may include a comment
  • 10.
  • 13. PROGRAMMING ARITHMETIC AND LOGIC OPERATIONS Implementation of Arithmetic and Logic Operations - Software Implementation - Implementation of an operation with a program using machine instruction set - Usually when the operation is not included in the instruction set - Hardware Implementation - Implementation of an operation in a computer with one machine instruction Software Implementation example: * Multiplication - For simplicity, unsigned positive numbers - 8-bit numbers -> 16-bit product
  • 14. - Logic and Shift Operations -
  • 17. Micro programmed Control  Hardwired Control Unit: When the control signals are generated by hardware using conventional logic design techniques, the control unit is said to be hardwired.  Micro programmed control unit: A control unit whose binary control variables are stored in memory is called a micro programmed control unit.
  • 18.  Control Memory: Control Memory is the storage in the microprogrammed control unit to store the microprogram.  Writeable Control Memory: Control Storage whose contents can be modified, allow the change in microprogram and Instruction set can be changed or modified is referred as Writeable Control Memory.  Control Word: The control variables at any given time can be represented by a control word string of 1 's and 0's called a control word.
  • 19. Micro-operation, Micro-instruction, Micro program, Microcode  Microoperations: In computer central processing units, micro-operations (also known as a micro- ops or μops) are detailed low-level instructions used in some designs to implement complex machine instructions (sometimes termed macro- instructions in this context).
  • 20. Micro instruction:  A symbolic microprogram can be translated into its binary equivalent by means of an assembler.  Each line of the assembly language microprogram defines a symbolic microinstruction.  Each symbolic microinstruction is divided into five fields: label, microoperations, CD, BR, and AD
  • 21. Micro program:  A sequence of microinstructions constitutes a microprogram.  Since alterations of the microprogram are not needed once the control unit is in operation, the control memory can be a read-only memory (ROM).  ROM words are made permanent during the hardware production of the unit.  The use of a micro program involves placing all control variables in words of ROM for use by the control unit through successive read operations.  The content of the word in ROM at a given address specifies a microinstruction.
  • 22. Microcode:  Microinstructions can be saved by employing subroutines that use common sections of microcode.  For example, the sequence of micro operations needed to generate the effective address of the operand for an instruction is common to all memory reference instructions.  This sequence could be a subroutine that is called from within many other routines to execute the effective address computation.
  • 23. Organization of micro programmed control unit  The general configuration of a micro- programmed control unit is demonstrated in the block diagram of Figure  The control memory is assumed to be a ROM, within which all control information is permanently stored.
  • 24.  The control memory address register specifies the address of the microinstruction, and the control data register holds the microinstruction read from memory.  The microinstruction contains a control word that specifies one or more microoperations for the data processor. Once these operations are executed, the control must determine the next address.  The location of the next microinstruction may be the one next in sequence, or it may be located somewhere else in the control memory.
  • 25.  While the microoperations are being executed, the next address is computed in the next address generator circuit and then transferred into the control address register to read the next microinstruction.  Thus a microinstruction contains bits for initiating microoperations in the data processor part and bits that determine the address sequence for the control memory.  The next address generator is sometimes called a micro-program sequencer, as it determines the address sequence that is read from control memory.  Typical functions of a micro-program sequencer are incrementing the control address register by one, loading into the control address register an address from control memory,transferring an external address, or loading an initial address to start the control operations.
  • 26.  The control data register holds the present microinstruction while the next address is computed and read from memory.  The data register is sometimes called a pipeline register.  It allows the execution of the microoperations specified by the control word simultaneously with the generation of the next microinstruction.  This configuration requires a two-phase clock, with one clock applied to the address register and the other to the data register.  The main advantage of the micro programmed control is the fact that once the hardware configuration is established; there should be no need for further hardware or wiring changes.  If we want to establish a different control sequence for the system, all we need to do is specify a
  • 27. Address Sequencing Microinstructions are stored in control memory in groups, with each group specifying a routine. To appreciate the address sequencing in a micro- program control unit, let us specify the steps that the control must undergo during the execution of a single computer instruction.
  • 28. Step-1:  An initial address is loaded into the control address register when power is turned on in the computer.  This address is usually the address of the first microinstruction that activates the instruction fetch routine.  The fetch routine may be sequenced by incrementing the control address register through the rest of its microinstructions.  At the end of the fetch routine, the instruction is in the instruction register of the computer.
  • 29. Step-2:  The control memory next must go through the routine that determines the effective address of the operand.  A machine instruction may have bits that specify various addressing modes, such as indirect address and index registers.  The effective address computation routine in control memory can be reached through a branch microinstruction, which is conditioned on the status of the mode bits of the instruction.  When the effective address computation routine is completed, the address of the operand is available in the memory address register.
  • 30. Step-3:  The next step is to generate the microoperations that execute the instruction fetched from memory.  The microoperation steps to be generated in processor registers depend on the operation code part of the instruction.  Each instruction has its own micro-program routine stored in a given location of control memory.  The transformation from the instruction code bits to an address in control memory where the routine is located is referred to as a mapping process.  A mapping procedure is a rule that transforms the instruction code into a control memory address.
  • 31. Step-4:  Once the required routine is reached, the microinstructions that execute the instruction may be sequenced by incrementing the control address register.  Micro-programs that employ subroutines will require an external register for storing the return address.  Return addresses cannot be stored in ROM because the unit has no writing capability.  When the execution of the instruction is completed, control must return to the fetch routine.  This is accomplished by executing an unconditional branch microinstruction to the first address of the fetch routine.
  • 32. Summary: the address sequencing capabilities required in a control memory are: 1. Incrementing of the control address register. 2. Unconditional branch or conditional branch, depending on status bit conditions. 3. A mapping process from the bits of the instruction to an address for control memory. 4. A facility for subroutine call and return.
  • 33. Selection of address for control memory Above figure shows a block diagram of a control memory and the associated hardware needed for selecting the next microinstruction address.
  • 34.  The microinstruction in control memory contains a set of bits to initiate microoperations in computer registers and other bits to specify the method by which the next address is obtained.  The diagram shows four different paths from which the control address register (CAR) receives the address.  The incrementer increments the content of the control address register by one, to select the next microinstruction in sequence.  Branching is achieved by specifying the branch address in one of the fields of the microinstruction.  Conditional branching is obtained by using part of the microinstruction to select a specific status bit in order to determine its condition.  An external address is transferred into control memory via a mapping logic circuit.  The return address for a subroutine is stored in a special register whose value is then used when the micro- program wishes to return from the subroutine.
  • 35.  The branch logic of figure provides decision-making capabilities in the control unit.  The status conditions are special bits in the system that provide parameter information such as the carry-out of an adder, the sign bit of a number, the mode bits of an instruction,and input or output status conditions.  The status bits, together with the field in the microinstruction that specifies a branch address, control the conditional branch decisions generated in the branch logic.  A 1 output in the multiplexer generates a control signal to transfer the branch address from the microinstruction into the control address register.  A 0 output in the multiplexer causes the address register to be incremented.
  • 36. Mapping of an Instruction  A special type of branch exists when a microinstruction specifies a branch to the first word in control memory where a microprogram routine for an instruction is located.  The status bits for this type of branch are the bits in the operation code part of the Instruction.For example, a computer with a simple instruction format as shown in figure belowhas an operation code of four bits which can specify up to 16 distinct instructions.  Assume further that the control memory has 128 words, requiring an address of seven bits.  One simple mapping process that converts the 4-bit operation code to a 7-bit address for  control memory is shown in figure below.  This mapping consists of placing a 0 in the most significant bit of the address, transferring the four operation code bits, and clearing the two least significant bits of the control address register.  This provides for each computer instruction a microprogram routine with a capacity of  four microinstructions.  If the routine needs more than four microinstructions, it can use addresses 1000000 through 1111111. If it uses fewer than four microinstructions, the unused memory locations would be available for other routines.
  • 37. microinstruction address •One can extend this concept to a more general mapping rule by using a ROM to specify the mapping function. •The contents of the mapping ROM give the bits for the control address register. •In this way the microprogram routine that executes the instruction can be placed in any desired location in control memory. •The mapping concept provides flexibility for adding instructions for control memory as the need arises.
  • 38.
  • 39.  A Hard-wired Control consists of two decoders, a sequence counter, and a number of logic gates.  An instruction fetched from the memory unit is placed in the instruction register (IR).  The component of an instruction register includes; I bit, the operation code, and bits 0 through 11.  The operation code in bits 12 through 14 are coded with a 3 x 8 decoder.  The outputs of the decoder are designated by the symbols D0 through D7.  The operation code at bit 15 is transferred to a flip-flop designated by the symbol I.  The operation codes from Bits 0 through 11 are applied to the control logic gates.  The Sequence counter (SC) can count in binary from 0 through 15.
  • 40.  The Control memory address register specifies the address of the micro-instruction.  The Control memory is assumed to be a ROM, within which all control information is permanently stored.  The control register holds the microinstruction fetched from the memory.  The micro-instruction contains a control word that specifies one or more micro-operations for the data processor.  While the micro-operations are being executed, the next address is computed in the next address generator circuit and then transferred into the control address register to read the next microinstruction.  The next address generator is often referred to as a micro-program sequencer, as it determines the address sequence that is read from control memory.