CS8491 Ca Unit 1
CS8491 Ca Unit 1
Unit – I
Basic structure of computer system
Functional Units – Basic Operational Concepts – Performance – Instructions: Language
ofthe Computer – Operations, Operands – Instruction representation – Logical
operations – decision making – MIPS Addressing.
1. FUNCTIONAL UNITS
A computer consists of five functionally
Components Of Computer System
independent main parts: input, memory,
1. Input Unit
arithmetic and logic, output, and control
2. Memory Unit
units.
2.1. Primary Memory
1.1. INPUT UNIT 2.1.1. Word
2.1.2. Word Length
Computers accept coded 2.1.3. Basic Operation
information through input units. 2.1.4. Address
Most common input device is the 2.2. Secondary Memory
keyboard. 2.2.1. Access Time
When a key is pressed, the 2.3. Arithmetic And Logic Unit
corresponding letter or digit is 2.3.1. Registers
automatically translated into its 2.3.2. One register – One word
corresponding binary code and 2.4. Output Unit
transmitted to the processor. 2.5. Control unit
2.5.1. Timing and synchronization
Programs must be stored in this memory while they are being executed. The memory consists
of a large number of semiconductor storage cells, each cell can store one bit of information.
These cells are rarely read or written individually. In general, they are handled in groups of
fixed size called WORDS . The memory is organized so that one word can be stored or
retrieved in one basic operation .
The number of bits in each word is referred to as the WORD LENGTH of the computer, typically
16, 32, or 64 bits.
To provide easy access to any word in the memory, a unique ADDRESS is associated with each
word location.
Addresses are consecutive numbers, starting from 0, that identify locations. A particular word
is accessed by specifying its address and issuing a control command to the memory that starts
the storage or retrieval process.
Most common example of output device is a printer. Printers are mechanical devices, and are
slow compared to the electronic speed of a processor.
Some units, such as graphic displays, provide both output function, and input function,
through touchscreen capability. The dual role of such units is the reason for using the single
name input/output (I/O) unit in many cases.
1. First the instruction is fetched from the memory into the processor.
Add R1, R0
Transfers between the memory and the processor are started by sending the address of
the memory location to be accessed to the memory unit and issuing the appropriate
control signals. The data are then transferred to or from the memory.
The fig shows how memory & the processor can be connected. In addition to the
ALU & the control circuitry, the processor contains a number of registers used for several
different purposes.
The instruction register (IR):- Holds the instructions that is currently being executed.
Its output is available for the control circuits which generates the timing signals that
control the various processing elements in one execution of instruction.
The program counter PC:-
This is another specialized register that keeps track of execution of a program. It
contains the memory address of the next instruction to be fetched and executed.
Besides IR and PC, there are n-general purpose registers R0 through Rn-1
The other two registers which facilitate communication with memory are: -
1. MAR – (Memory Address Register):- It holds the address of the location to be
accessed.
2. MDR – (Memory Data Register):- It contains the data to be written into or read
out of the address location.
3. PERFORMANCE OF A COMPUTER
Determining the performance of computers
Performance of A Computer
can be tough. Main reasons for this
Size and Complexity
difficulty are,
performance improvement techniques
Size and Complexity of 1. Defining Performance
Response time
modern software systems,
Throughput
Wide range of performance
1
improvement tech niques 𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒𝑥 =
𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝑥
used by hardware designers.
2. Relative Performance
𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒𝐴 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐵
3.1. DEFINING PERFORMANCE =
𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒𝐵 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐴
If a program is run on two different desktop 3. Measuring Performance
computers, in general the faster one is the clock time
desktop computer that finishes the job done 4. CPU Execution Time
first. 4.1. Types of CPU time
User CPU time
Consider a datacenter that had several System CPU time
servers running jobs submitted by many System clock
users, in general the faster computer is the Clock cycles
one that completed the most jobs during a
day.
Consider two computers X and Y, if the performance of X is greater than the performance of Y, then
𝟏 𝟏
>
𝑬𝒙𝒆𝒄𝒖𝒕𝒊𝒐𝒏 𝑻𝒊𝒎𝒆𝒙 𝑬𝒙𝒆𝒄𝒖𝒕𝒊𝒐𝒏 𝑻𝒊𝒎𝒆𝒚
If computer A runs a program in 10 seconds and computer B runs the same program in 15 seconds,
how much faster is A than B.
𝟏𝟓/𝟏𝟎 = 𝟏. 𝟓
𝑷𝒆𝒓𝒇𝒐𝒓𝒎𝒂𝒏𝒄𝒆𝑨
= 𝟏. 𝟓
𝑷𝒆𝒓𝒇𝒐𝒓𝒎𝒂𝒏𝒄𝒆𝑩
P ERFORMANCE AND EXECU T I ON TIME ARE RECIPR O CALS , increasing performance decreases execution
time.
The most common definition of time is wall clock time, response ti me or elapsed
time.
Processor may work on several programs simultaneously in order to optimize throughput instead of
minimizing the elapsed time for one program.
We need to differentiate the elapsed time and amount of time which the processor is working on the
program. CPU execution time is used to differentiate this.
Differentiating between system and user CPU time is difficult to do accurately, to increase the system
performance the computer designers must know how fast th e hardware can perform
basic functions .
In general CPU performance is a one of metrics for measuring the performance. To know the CPU
performance we must find the CPU execution time.
𝟏
𝑪𝒍𝒐𝒄𝒌 𝑪𝒚𝒄𝒍𝒆 𝑻𝒊𝒎𝒆 =
𝑪𝒍𝒐𝒄𝒌 𝑹𝒂𝒕𝒆
It is clear that the hardware designer can IMPROVE PERFORMANCE by reducing the number of
clock cycles required for a program or the length of th e clock cycle .
These formulas are used to compare two different implementati ons or to evaluate a
design alternative.
Consider the computer with three instruction classes and CPI measurement as given below and
instruction count for each instruction class for the same program from two different compilers
are given. Assume that the computer`s clock rate is 4GHz. Which code sequence will execute
faster according to execution time
COMPILER 1:
Total CPU time of Compiler 1 is the sum of CPU time of all Instruction Classes
2×1 1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶1𝐴 = =
4 2
1×2 1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶1𝐵 = =
4 2
2×3 3
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶1𝐶 = =
4 2
1 1 3 5
𝑇𝑜𝑡𝑎𝑙 𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶1 = + + = = 2.5
2 2 2 2
COMPILER 2:
Total CPU time of Compiler 2 is the sum of CPU time of all Instruction Classes
4×1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶2𝐴 = = 1
4
1×2 1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶2𝐵 = =
4 2
2×1 1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶2𝐶 = =
4 2
1 1
𝑇𝑜𝑡𝑎𝑙 𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶2 = 1 + + = 2
2 2
The CPU time required for the execution various class of instruction by compiler 2 is less than that of
compiler 1, therefore compiler 1 is faster than compiler 2.
add a, b, c
It instructs a computer to add the two variables b and c and to put their sum in a.
For example, If we want to calculate the sum of four variables b, c, d, e and to place the result in the
variable a.
Every instruction has exactly three operands, this rule is followed to keep the hardware simple
a = b + c;
d = a - e;
add a, b, c
sub d, a, e
Consider a complex C program statement contains the five variables f, g, h, i, and j in the same
statement,
f = (g + h) – (i + j);
The compiler must break this statement into several assembly instructions, since only one operation is
performed per MIPS instruction.
The first MIPS instruction calculates the sum of g and h. We must place the result in a temporary
variable, called t0:
The second instruction places the sum of i and j in another temporary variable called t1:
Next we need to subtract the second sum from the first sum and places the difference in the variable
f,
A major difference between the variables of a programming language and registers is the limited
number of registers.
The three operands of MIPS arithmetic instructions must each be chosen from one of the available 32
registers each 32-bits.
f = (g + h) – (i + j);
The above C statement is compiled into MIPS assembly language using registers as follows
The processor can keep only a small amount of data in registers data structures (arrays and structures)
are kept in memory.
Arithmetic operations occur only on registers in MIPS instructions; thus, MIPS must include
instructions that transfer data between memory and registers. Such instructions are called DATA
TRANS FER INSTRUCTIO NS .
The format of the load instruction is the name of the operation followed by the register to
be loaded, then a constant and register used to access memory. The sum of the constant portion of the
instruction and the contents of the second register forms the memory address.
g = h + A[8];
There is a single operation in this assignment statement, but one of the operands is in memory, so we
must first transfer A[8] to a register.
The address of this array element is the sum of the base of the array A, plus the number of the element.
The data should be placed in a temporary register for use in the next instruction.
The constant in a data transfer instruction (32) is called the offset, and the register used
to store the base address ($s3) is called the base register .
The actual MIPS addresses for the words is the byte address of the third word is 32.In MIPS, words
must start at addresses that are multiples of 4. This requirement is called an ALIGNMENT RESTRICTIO N .
Some computers use the address of the leftmost or “big end” byte as
the word address these computers are called big-endian and
other computers use the rightmost or “little end” byte and these
computers are called as little -endian. MIPS follows big-endian
addressing.
The format of a store is similar to that of load: the name of the operation, followed by the register to
be stored, then offset to select the array element, and finally the base register.
A[12] = h + A[8];
The first two instructions are the same as in the prior example, except this time we use the proper
offset for byte addressing in the load word instruction to select A[8], and the add instruction places
the sum in $t0:
In order to use constants in an operation, the constants should be placed in the memory when the
program is loaded and we have to load it from memory to execute the statement.
For example, to add the constant 4 to register $s3, we could use the code
An alternative to avoid the load instruction is to use the “ IMMEDIATE ” instruction. The quick add
instruction with one constant operand is called ADD IMMEDIATE or addi.
Constant operands occur frequently, and by including constants inside arithmetic instructions,
operations are much faster and use less energy than if constants were loaded from
memory. This is an example of making the COMMON CASE FAST .
6. REPRESENTING INSTRUCTIONS
Instructions are kept in the
Representing Instructions
computer as a series of high and
R-type or R-format
low electronic signals and can be
I-type or I-format
represented as numbers.
J-type or J-format
Each instruction can be represented
1. R-type or R-format
as a field of binary number, this
3 operands as registers
representation is called the
op rs rt rd shamt funct
instruction format . Once
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits
the MIPS instructions are 2. I-type or I-format
converted as binary numbers then 16 bit constant or address field
the instruction is called as op rs rt constant or address
Machine Instruction . 6 bits 5 bits 5 bits 16 bits
All of the MIPS instructions are of 3. J-type Instructions
32 BITS LONG and can be classified Jump & goto
into any one of the three formats or op Jump Address
types. They are, 6 bits 28 bits
R-type or R-format
I-type or I-format
J-type or J-format
Op rs rt rd shamt funct
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits
op represents Operation, it is called as opcode.
rs is the first register source operand
rt is the second source operand
rd is the destination register to store the result
shamt is the shift amount
funct is the function field, it specifies the variant of the operation.
Solution:
The instruction is a R-type instruction, the format of the R-type instruction is
op rs rt rd shamt funct
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits
0 17 18 8 0 32
The above decimal representation should be converted as binary in order to get the machine
instruction.
op rs rt constant or address
6 bits 5 bits 5 bits 16 bits
The similarity between the R-type and I-type instructions are that the length of both the type of
instructions are 32 bits. The description of the fields are as follows.
The first 3 fields are same as the R-type instruction, since the I-type instruction does not have a
second source operand register rt is used as the destination register and the last three fields of the R-
type instruction is combined together as a 16 bit constant or address field .
Solution:
The instruction is a R-type instruction, the format of the R- T YPE instruction is
Op rs rt constant or address
6 bits 5 bits 5 bits 16 bits
8 17 8 20
The above decimal representation should be converted as binary in order to get the machine
instruction.
J-type instruction is also similar to R-type and I-type instructions, it is of the same size 32 bits. Even
though the designers of MIPS could not use the same instruction format for all instructions, they have
used the same number of bits for all instruction following the design principle.
op Jump Address
6 bits 28 bits
Example: Translate the MIPS assembly instruction into Machine Instruction
j Exit
Exit is the label to which the control has to jump, consider it is at the location 1200
Solution:
2 1200
The above decimal representation should be converted as binary in order to get the machine
instruction.
000010 0000000000000000010010110000
7. LOGICAL OPERATIONS
In the beginning the operations performed where limited to an entire word, but later operations had to
be performed on individual bits. The following table shows the MIPS supported logical operations
along with the C and Java equivalent of those operations.
Example: Consider two registers, $t2 and $S0. The register $S0 contains a value 9. What would be
the content of $t2 after the following instructions are executed?
a) sll $t2, $S0,4
b) srl $t2, $S0, 2
Solution:
sll $t2, $S0, 4 is the equivalent of the $t2 = $S0 << 4
$S0 contains the value 9
It is represented in binary as
0000 0000 0000 0000 0000 0000 0000 1001
sll $t2,$s0,4
op Rs rt rd shamt funct
0 0 16 10 4 0
shamt field used in the shift instructions, stands for shift amount.
The opcode of sll is 0 in both the op and funct fields are set as 0, rd contains 10 (register $t2), rt
contains 16 (register $s0), and shamt contains 4. The rs field is unused and thus is set as 0.
Shift left logical provides a bonus benefit. Shifting left by i bits gives the same result as multiplying
by 2i.
7.2. LOGICAL AND OPERATION
AND is a logical bit-by-bit operation with two operands that calculates a 1 only if there is a 1 in both
operands.
AND $t0, $t1, $t2 # reg $t0 = reg $t1 & reg $t2
AND can be applied to set a bit pattern, to force 0s where there is a 0 in the bit pattern. Such a bit
pattern made using AND is called a mask, the mask is used to “conceal” some bits.
7.3. LOGICAL OR OPERATION
It is a bit-by-bit operation that places a 1 in the result if either operand bit is a 1.
The designers of MIPS decided to include the instruction NOR (NOT OR) instead of NOT. If one
operand is zero, then it is equivalent to
Register $t3 has the value 0, the result of the MIPS instruction
NOR $t0, $t1, $t3 # reg $t0 = ~ (reg $t1 | reg $t3)
Constants are rare for NOR, since its main use is to invert the bits of a single operand; thus, the MIPS
instruction set architecture has no immediate version of NOR.
8. DECISION MAKING
The difference between a computer Decision Making
and a simple calculator is its ability to
1. Conditional Branch
make decisions. Decision making is
1.1. Branch-if-Equal Statement
commonly represented in
beq register1, register2, L1
programming languages using the
“if” statement, sometimes combined 1.2. Branch-if-not-Equal Statement
with “goto” statements and labels. bne register1, register2, L1
2. Loop Instruction
8.1. CONDITIONAL BRANCH Loop: sll $t1,$s3,2
3. Case/Switch Statement
An instruction that compares two Jump address table or jump table
values and transfers control to a new Jump register (JR)
address in the program based on the
outcome of the comparison.
MIPS assembly language includes two decision-making instructions, similar to an “if” statement with
a “goto”.
This instruction means go to the statement labelled L1 if the value in register1 equals the value in
register2. The mnemonic beq stands for branch if equal.
It means go to the statement labelled L1 if the value in register1 does not equal the value in
register2. The mnemonic bne stands for branch if not equal.
Example: In the following code segment, f, g, h, i, and j are variables. If the five variables f
through j correspond to the five registers $s0 through $s4, what is the compiled MIPS code for this
C if statement?
if (i == j)
f = g + h;
else
f = g – h;
Solution:
The first expression compares for equality, so it looks like it is better to use branch-if-equal
instruction (beq).
In general, the code will be more efficient if we test for the opposite condition so we use the branch
if not equal instruction (bne):
bne $s3,$s4,Else # go to Else if i ≠ j
Now we need to go to the end of the if statement, Unconditional branch statement (Jump
instruction) can be used,
The assignment statement in the else portion of the if statement can be compiled into a single
instruction. We have to append the label Else to this instruction.
Exit:
while (save[i] == k)
i += 1;
Assume that i and k correspond to registers $s3 and $s5 and the base of the array save is in $s6.
The first step is to load save[i] into a temporary register. Before we can add i to the base of array
save to form the address, we must multiply the index i by 4 due to the byte addressing problem.
Instead of multiplying index i by 4, we can use shift left logical, shifting left by 2 bits is equal to
multiplying by 22 or 4.
To get the address of save[i], we need to add $t1 and the base of save in $s6:
Now we can use that address to load save[i] into a temporary register:
addi $s3,$s3,1 # i = i + 1
The end of the loop branches back to the while test at the top of the loop. We add the Exit label after
it,
j Loop # go to Loop
Exit:
The test for equality or inequality is probably the most popular test, but sometimes it is useful to see if
a variable is less than another variable.
A for loop tests if the index variable is less than 0. The MIPS instruction used to test is called set on
less than, or slt. If the test is true then a third register is set to 1 else it is set to 0.
slt $t0, $s3, $s4 # $t0 = 1 if $s3 < $s4 else $t0 = 0.
Register $t0 is set to 1 if the value in register $s3 is less than the value in register $s4 else, register
$t0 is set to 0.
Constant operands are used in most of the comparisons, so there is an immediate version of the set
on less than instruction. To test if register $s2 is less than the constant 10, we can just write
MIPS compilers use the slt, slti, beq, bne, and 0 to create all relative conditions: equal, not
equal, less than, less than or equal, greater than, greater than or equal.
A binary number with a 1 in the most significant bit can represents a negative number, it is less than
any positive number. Positive numbers have a 0 in the most significant bit. In unsigned integers a 1 in
the most significant bit represents a number that is larger than any number that begins with a 0.
Set on less than (slt) and set on less than immediate (slti) work with signed integers
Set on less than unsigned (sltu) and set on less than immediate unsigned (sltiu)
works with unsigned integers
What are the values of registers $t0 and $t1 after these two instructions?
slt $t0, $s0, $s1 # signed comparison
sltu $t1, $s0, $s1 # unsigned comparison
Solution:
The content of the register $S0 has a 1 in the most significant bit, in case of a signed number
comparison it would be treated as a negative number, so the content of $S0 is less than the content
of the register $S1.
While using a unsigned number comparison the content of $S0 is larger than the content of $S1.
The values of the registers $t0 and $t1 would be 0 and 1 respectively
A more efficient alternative is to encode as a table of addresses, called a jump address table or jump
table, the program indexes into the table and then jump to the correct instruction to be executed. The
jump table is an array of words containing addresses that correspond to labels in the code. The
program loads the correct address and label from the jump table into a register. It then needs to jump
using the address in the register.
MIPS include a JUMP REGISTER ( JR ) instruction, It is an unconditional jump to the address specified in
the register.
Example:
What is the MIPS assembly code to load this 32-bit constant into register $s0?
0000 0000 0011 1101 0000 1001 0000 0000
First, we would load the upper 16 bits, which is 61 in decimal, using lui:
lui $s0, 61 # 61 decimal = 0000 0000 0011 1101 binary
The next step is to insert the lower 16 bits, whose decimal value is 2304:
ori $s0, $s0, 2304 # 2304 decimal = 0000 1001 0000 0000
lw $S5,16($S2)
beq $t0,$t3,Label
j Exit
Assume a two address format specified as source, destination. Examine the following sequence
of instructions and explain the addressing modes used and the operation done in every
instruction.
i. Move (R5)+, R0
ii. Add (R5)+, R0
iii. Move R0, (R5)
iv. Move 16(R5), R3
v. Add #40, R5
Move (R5)+, R0
Register-Indirect with increment Addressing mode, Increments the contents of R5 by 1 and loads it to
R0.
Add (R5)+ R0
Register-Indirect with increment Addressing mode, Increments the contents of R5 by 1, adds the
result to R0 and stores the result in R0
R0 = ((R5)+1)+R0.
Register Differed addressing mode, content of R0 is moved to the memory location of R5.
Move 16(R5), R3
Add #40, R5
PART – A
The five classic components of a computer are input, output, memory, datapath, and control, with
the last two sometimes combined and called the processor.
PROCESSOR TECHNOLOGY
2. What is meant by Stored Program Concept? [May/June 2007]
By using stored programming concept the performance of the processor is only as good as the
performance of the memory, this limits the maximum utilization of the available processing
capability. This condition is called as Von-Newmann Bottleneck
5. Distinguish pipelining from parallelism. [April/May 2015]
Pipelining is the process of making the functional units of the CPU independent and this helps in
increasing the throughput of the processor.
Parallelism is the process of executing more than one instruction in parallel, this requires
redundant hardware for functional units, whereas pipelining does not require redundancy,
Parallelism decreases execution time.
PERFORMANCE OF A COMPUTER
6. What is defined as performance of a computer?
Response time is the actual execution time of a single program or an individual task.
Throughput is also called as Bandwidth, it is the number of tasks completed per unit time.
8. What is Execution Time?
It is also called as response time. It is the total time required for the computer to complete a task,
including disk accesses, memory accesses, I/O activities, operating system overhead, etc.
9. What is CPU Execution Time?
It is also called as CPU time, it is the actual amount of time the CPU spends computing for a
particular task.
10. Define CPI
CPI is Clock Cycles per Instruction. It is the average number of clock cycles each instruction
takes to execute. CPI is useful in comparing two different implementations of the same instruction
set architecture.
The instruction set architecture, or simply architecture of a computer is the interface between the
hardware and the lowest-level software. It includes anything programmers need to know to make
a binary machine language program work correctly, including instructions, I/O devices, and so on.
12. Define – ABI
Typically, the operating system will encapsulate the details of doing I/O, allocating memory, and
other low-level system functions so that application programmers do not need to worry about such
details. The combination of the basic instruction set and the operating system interface provided
for application programmers is called the application binary interface (ABI).
13. What are the fields in an MIPS instruction?
The quick add instruction with one constant operand is called add immediate or addi. To add 4 to
register $s3, we just write
addi $s3,$s3,4 #$s3 = $s3+4
REPRESENTING INSTRUCTIONS
15. Define Opcode.
Opcode is abbreviated from operation code, it is the portion of a machine language instruction
that specifies the operation to be performed.
16. What does the design principle “Good Design Demands Good Compromises”
mean?
Even though the designers of MIPS could not use the same instruction format for all instructions,
they have used the same number of bits for all instruction in order to reduce the complexity of the
design, based on the design principle “Good Design Demands Good Compromises”.
In Immediate Addressing mode, the operand is a constant within the instruction itself, this
eliminates the need for loading the constant operand into a memory location and using the
memory address to perform the operation. By doing so the total number of individual
instructions required is reduced, for this reason Immediate Addressing is considered to be
important and more commonly used.
19. Brief about Relative Addressing mode with an example. [Nov/Dec 2014]
In relative addressing mode, the branch address is the sum of the program counter and a constant
in the instruction.
beq $S0,$S3,Label
PART – B
COMPONENTS OF A COMPUTER SYSTEM
1. Explain the various components of computer System with neat diagram
[Nov/Dec 2014-16M][April/May-2018-8M].[Refer Pg No:1.1]
PERFORMANCE OF A COMPUTER
2. Discuss in detail the various measures of performance of a computer
[Nov/Dec 2014 – 8M] [Refer Pg No:1.6]
3. Consider the computer with three instruction classes and CPI measurement as
given below and instruction count for each instruction class for the same
program from two different compilers are given. Assume that the computer`s
clock rate is 4GHz. Which code sequence will execute faster according to
execution time
Code from CPI for this Instruction Class
A B C
CPI 1 2 3
Code from Instruction Count for each class
A B C
Compiler 1 2 1 2
Compiler 2 4 1 1
[Nov/Dec 2014 – 6M]
REPRESENTING INSTRUCTIONS
6. Explain how the high-level language statements are represented as assembly
language instructions in a computer. [Refer Pg No:1.16]
[OR]
Explain the difference between how the humans provide instructions to a
computer and the computer views it. [Refer Pg No:1.16]
[OR]
7. Discuss about various techniques to represent instructions in a computer system
[April / May 2015 – 16M] [Nov/Dec-2017-13M] [Refer Pg No:1.16]
11. Assume a two address format specified as source, destination. Examine the
following sequence of instructions and explain the addressing modes used
and the operation done in every instruction.
1. Move (R5)+, R0
2. Add (R5)+, R0
3. Move R0, (R5)
4. Move 16(R5), R3
5. Add #40, R5
[Nov/Dec 2014 – 10M]