Computer Architecture and Organization
Computer Architecture and Organization
On
Computer Architecture and
Organization
SUBMITTED TO-
SUBMITTED BY-
DR. SUMIT MOUDGIL SAMBHAV JAIN
ASSISTANT PROFESSOR (181302070)
(CSE DEPARTMENT) B.TECH. - CSE(IBM)
4TH SEMESTER
Questions
Usually, a real number in binary will be represented in the Depending on base and the number of bits used to encode
following format, various components, the IEEE 754 standard defines five
basic formats. Among the five formats, the binary32 and the
binary64 formats are single precision and double precision
ImIm-1…I2I1I0.F1F2…FnFn-1 formats respectively in which the base is 2.
Where Im and Fn will be either 0 or 1 of integer and fraction parts Precision Base Sign Exponent Significa
respectively. nd
Single 2 1 8 23+1
A finite number can also represented by four integers components, precision
a sign (s), a base (b), a significand (m), and an exponent (e). Then
the numerical value of the number is evaluated as Double 2 1 11 52+1
precision
(-1)s x m x be ________ Where m < |b|
1. Single Precision Format
As mentioned in Table, the single precision format has 23 bits for significand (1 represents implied bit, details
below), 8 bits for exponent and 1 bit for sign.
For example, the rational number 9÷2 can be converted to single precision float format as following,
9(10) ÷ 2(10) = 4.5(10) = 100.1(2)
The result said to be normalized, if it is represented with leading 1 bit, i.e. 1.001(2) x 22. (Similarly when the
number 0.000000001101(2) x 23 is normalized, it appears as 1.101(2) x 2-6). Omitting this implied 1 on left extreme
gives us the mantissa of float number. A normalized number provides more accuracy than corresponding de-
normalized number. The implied most significant bit can be used to represent even more accurate significand (23
+ 1 = 24 bits) which is called subnormal representation. The floating point numbers are to be represented in
normalized form.
The subnormal numbers fall into the category of de-normalized numbers. The subnormal representation slightly
reduces the exponent range and can’t be normalized
since that would result in an exponent which doesn’t fit in the field. Subnormal numbers are less accurate,
i.e. they have less room for nonzero bits in the fraction field, than normalized numbers. Indeed, the accuracy
drops as the size of the subnormal number decreases. However, the subnormal representation is useful in filing
gaps of floating point scale near zero.
In other words, the above result can be written as (-1)0 x 1.001(2) x 22 which yields the integer components as s
= 0, b = 2, significand (m) = 1.001, mantissa = 001 and e = 2. The corresponding single precision floating
number can be represented in binary as shown below,
Where the exponent field is supposed to be 2, yet encoded as 129 (127+2) called biased exponent. The
exponent field is in plain binary format which also represents negative exponents with an encoding (like sign
magnitude, 1’s complement, 2’s complement, etc.). The biased exponent is used for the representation of
negative exponents. The biased exponent has advantages over other negative representations in performing
bitwise comparing of two floating point numbers for equality.
A bias of (2n-1 – 1), where n is number of bits used in exponent, is added to the exponent (e) to get biased
exponent (E). So, the biased exponent (E) of single precision number can be obtained as
E = e + 127
The range of exponent in single precision format is -128 to +127. Other values are used for special symbols.
1. Double Precision Format
Eg: 3.02×10^3 + 7×10^3 = 1.002 × 10^4
Eg: 3×10^3 × 7×10^4 = 2.1×10^8
Eg: 3.1×10^3 – 3×10^3 = 1×10^2
Eg: 3×10^4 ÷ 1.5×10^2 = 2×10^2
2. Short Note on RAM and ROM
Primary Memory is quite fast which works at electronic speed. Programs should be stored in memory before
getting executed. Random Access Memory are those memory in which location can be accessed in a
shorter period of time after specifying the address.
Primary memory is essential but expensive so we went for secondary memory which is quite cheaper. It is
used when large amount of data & programs are needed to store, particularly the information that
we don't access very frequently. Ex- Magnetic Disks, Tapes
3. ALU, CU, Memory Unit
To perform any useful task, the computer must interact with outside world
And this is done with the help of input/output operations.
It provides the necessary data communication link between the processor and the
enviroment
Information is accepted through input devices, then processed by the processor and
output is shown to the users with the help of output devices
4. Types of Input/Output Operations
Programmed I/O:
In which I/O occurs under the direct and continuous control of the program requesting the I/O operation
Interrupt-driven I/O:
In which a program issues an I/O commandant then continues to execute, until it is interrupted by the I/O
hardware to signal the end of the I/O operation
Stack Queue
A stack is a container of objects that are inserted and removed A queue is a container of objects (a linear collection) that are
according to the last-in first-out (LIFO) principle. In the pushdown inserted and removed according to the first-in first-out (FIFO)
stacks only two operations are allowed: push the item into the stack, principle. An excellent example of a queue is a line of students in
and pop the item out of the stack. A stack is a limited access data the food court of the UC. New additions to a line made to the back
structure - elements can be added and removed from the stack only at of the queue, while removal (or serving) happens in the front. In
the top. push adds an item to the top of the stack, pop removes the item the queue only two operations are allowed enqueue and dequeue.
from the top. A helpful analogy is to think of a stack of books; you can Enqueue means to insert an item into the back of the queue,
remove only the top book, also you can add a new book on the top. dequeue means removing the front item. The picture demonstrates
the FIFO access
Applications:
The simplest application of a stack is to reverse a word. You push a given Applications:
word to stack - letter by letter - and then pop letters from the stack.
Serving requests on a single shared resource, like a printer, CPU task
scheduling etc.
5. Multiple Bus Organization
Multiple bus organization is primarily used in industrial systems. In this structure, various devices that
have different transfer rates can be connected. At the same time, maximum throughput is maintained.
The control hardware can be viewed as a state machine that changes from one state to another in every
clock cycle, depending on the contents of the instruction register, the condition codes and the external
inputs. The outputs of the state machine are the control signals. The sequence of the operation carried out
by this machine is determined by the wiring of the logic elements and hence named as “hardwired”.
Fixed logic circuits that correspond directly to the Boolean expressions are used to generate the control
signals.
Hardwired control is faster than micro-programmed control.
A controller that uses this approach can operate at high speed.
RISC architecture is based on hardwired control unit
6. Fast Adder
A carry-look ahead adder (CLA) or fast adder is a type of adder used in digital logic.
A carry-look ahead adder improves speed by reducing the amount of time required to determine carry bits.
It can be contrasted with the simpler, but usually slower, ripple-carry adder (RCA), for which the carry bit is calculated
alongside the sum bit, and each stage must wait until the previous carry bit has been calculated to begin calculating its
own sum bit and carry bit.
The carry-lookahead adder calculates one or more carry bits before the sum, which reduces the wait time to calculate the
result of the larger-value bits of the adder
A carry-Lookahead adder is a fast parallel adder as it reduces the propagation delay by more complex hardware, hence it
is costlier.
This method makes use of logic gates so as to look at the lower order bits of the augend and addend to see whether a
higher order carry is to be generated or not.
6. Digital Circuit and Truth Table of Fast Adder
6. Explanation of Diagrams
6. Explanation Continues
7. Assembly Language
Because assembly depends on the machine code instructions, every assembler has its own assembly
language which is designed for exactly one specific computer architecture. Assembly language may also be
called symbolic machine code.
Assembly code is converted into executable machine code by a utility program referred to as an assembler.
The conversion process is referred to as assembly, as in assembling the source code.
7. Addressing Modes and Types
Addressing modes refers to the way in which the operand of an instruction is specified. The
addressing mode specifies a rule for interpreting or modifying the address field of the
instruction before the operand is actually executed
1. Immediate
2. Register
3. Direct
4. Indirect
5. Register Indirect
6. Stack
7. Immediate and Register Addressing Mode
The operand’s offset is given in the instruction as an 8 In this mode address field of instruction
bit or 16 bit displacement element. In this contains the address of effective address.
addressing mode the 16 bit effective address of
the data is the part of the instruction. Here two references are required.
Here only one memory reference operation is 1st reference to get effective address.
required to access the data. 2nd reference to access the data.
7. Registered Indirect and Stack Addressing Mode