Documente Academic
Documente Profesional
Documente Cultură
Arithmetic
Input
Control logic unit
unit
Output
Accumulator
Fig.: The original von Neumann machine
The von Neumann machine had five basic parts : the memory, the arithmetic logic unit, the
control unit, and the input and output equipment. The memory consisted of 4096 words, a word
holding 40 bits, each a 0 or a 1. Each word held either two 20-bit instructions or a 40-bit signed
integer. The instructions had 8 bits devoted to telling the instruction type and 12 bits for
specifying one of the 4096 memory words.
Inside the arithmetic logic unit was a special internal 40-bit register called the accumulator. A
typical instruction added a word of memory to the accumulator or stored the contents of the
accumulator in memory. The machine did not have floating-point arithmetic because von
Neumann felt that any competent mathematician ought to be able to keep track of the decimal
point (actually the binary point).
64 bit
63 62 52 51 0
i
S E M
The 64−bit standard representation shown in Fig. 2 is called a double − precision representation
because it occupies two 32−bit words. The 64−bits are divided into three fields as shown below :
• (field 1) Sign ← 1 − bit
• (field 2) Exponent ← 11 − bits
• (field 3) Mantissa ← 52 − bits
In the double precision format value actually stored in the exponent field is given as,
E′′ = E + 1023
Hence, bias value is 1023 and hence, it is also called as excess − 1023 format. The end values of
E′ viz. 0 and 2047, are used to indicate the floating point exact values of exact zero and infinity,
respectively. Thus, the range of E′ for normal values in double precision is 0 < E′ < 2047. This
means that for 64−bit representation the actual exponent E is in one range − 1022 ≤ E ≤ 1023.
(i) 15.4 :
Binary = (1111 . 0110011)2
Normalized the number = 1.1110110011 × 23
for single precisions
S = 0, E = 3 and M = 1110110011
E′ = E + 127
= 3 + 127
= 130
= (10000010)2
Number in 32−bit format is given as,
0 10000010 1110110111 …….0
S E M
Prelim Question Paper Solutions (3)
Double precision
S = 0, E = 3 and M = 1110110011
E′ = E + 1023
= 3 + 1023
= 1026
= (10000000010)2
In double precision format
0 000000010 1110110011 … 0
(ii) (B F C 00000)H S E M
Given number
0 1011 1111 1100 0000 …. 0
Exponent = 191
E′ = E + 127
= 191 − 127
= 64
1. (c) Active
Control APP A, B
DP Signals
p q r s MUX1
s
A&B
RF
A Write A
B Read A
Read B
A B
u v MUX
s 2 Select u−w
w x y z Select v−x
A B
F1 F2
A+B Add
Overflow
Operand
(6) Register indirect addressing
In this register indirect mode the instruction
opcode specifies an internal register or Opcode
register pair which contains the effective
Register Rn CPU
address to be used for accessing operand in
Register
memory. This mode is used to save Memory
program space & improve speed of
program execution in situations where data Effective
elements are to be accessed from memory. Rn address
The instruction format of register indirect Operand
addressing is as shown in fig.
EA
Operand
EA
Operand
EA
Operand
(11)Implied addressing
Implied addressing also called as implicit addressing or inherent addressing. It is available in
some processors. In this case the instruction opcode doesn’t specify register or memory. It
automatically implies the operand position. As an example it is implied that operand is available
in specific register, the opcode doesn’t give register code but assumes it is present.
(12)Bit addressing
In bit addressing mode the operand is a specific bit within the words stored in memory or
registers. The instruction address of these individual bits uses a combination of other addressing
modes such as register, register indirect etc.
(iii)
DRAM SRAM
(i) It is made with cells that store data as (i) Binary values are stored using traditional
charge on capacitors (binary 1 and 0 flip−flop logic gate configurations.
represents presence and absence of charge
respectively)
(ii) Dynamic RAMs required periodic charge (ii) It will hold its data as long as power is
refreshing to maintain data storage. supplied to it.
(iii) It favours large memory requirements. (iii) Not suitable for large memory
requirement.
(iv) These are generally slower than SRAMs. (iv) These are generally faster than DRAMs.
(v) DRAM is more dense and less expensive (v) SRAM is less dense and more expensive
than a corresponding SRAM. than a corresponding DRAM.
(iv)
Synchronous Bus Asynchronous Bus
(i) The occurrence of events on the bus is (i)
The occurrence of one event on a bus
determined by a clock. follows and depends on the occurrence of
a previous event.
(ii) All devices in this bus are tied to a fixed (ii) A mixture of slow and fast devices, using
clock rate, the system cannot take advantage older and newer technology can share a
of advances in device performance. bus.
(iii) It is less flexible than asynchronous (iii) It is more flexible than synchronous
timing. timing.
(iv) Simpler to implement and test. (iv) Less simpler to implement and test.
2. (c) x3 x0
y3 y0
EAND
4
4
M 4
U Z
4 X
EOR 4 4
Not
4 bit used
4 adder 2 bit
y0
y1 Output
CIN select lines
y2
Truth Table for 4-bit adder − substractor
SUB Output
y3 1 X−Y
0 X+1
SUB
Prelim Question Paper Solutions (9)
Above 4-bit ALU includes function select lines such as EAND, EOR, SUB.
ALU Design Steps :
1. First of all define the capacity of ALU (e.g., here it is 4-bit).
2. Implement necessary logical section using standard logic gates and mark them with necessary
function select lines e.g., EAND.
3. Select appropriate type of adder on the basis of cost and speed expected.
4. Implement adder-substractor unit with the help of array of Ex-OR gates to provide function
select line SUB.
5. Combine the logical and arithmetic sections using appropriate size of MUX.
3. (a) SPARC Architecture
• SPARC (Scalable Processor Architecture) is RISC processor
• SPARC architecture was initially developed by Sun and is based on RISCII design
from university of California.
• 32 bit SPARC was introduced in 1987
• 64 bit SPARC was introduced in 1995
Registers in SPARC r31 i7
• It has 32 general purpose 64 bit registers r0 − r31
• These 32 registers divided into 4 groups each of 8 registers like
(i) global register (g0 − g7) i1
i0
(ii) out register (O0 − O7) L7
(iii) local register (L0 − L7)
(iv) in register (i0 − i7)
L1
• SPARC uses register windows where each window consist of 24 L0
registers which consists of registers, local registers and out registers. O7
• The 'out registers' of one set overlaps with 'in register' of adjacent set
• The CWP (current window pointer) register gives the current O1
window information O0
g7
• The CWP can be increment or decrement by two instruction
1. The restore instruction decrement CWP register
2. The save instruction increment CWP register r1 g1
r0 g0
• The SPARC also maintains another set of 8 alternate global (AG) 63 0
registers.
63 0
• Thus in an implementation with 64 registers SPARC.
PC
• Thus in an implementation with 64 registers SPARC we can have
THREE sets (of 8 global 8 alternate global and the sets of 16 register 63 0
each) CWP−1 nPC
Out O7
4 0
reg. O0
Local L7 CWP
reg. L0 Window CWP
7 4 3 0
in i7 Out O7
reg. i0 reg. O0 xcc icc
Local L7
CCR
reg. L0 Window (CWP + 1)
in i7 Out O7
g7 reg. i0 reg. O0
Local L7
CCR (Condition code register) :- This register is similar to Flag register of Pentium processor. It
provides two 4 bit integer condition code fields: xcc and icc as shown below:
(10) Vidyalankar : S.E. – COA
xcc icc
n z v c n z v c
sign zero over carry
(negative) flow
The xcc record status information when the operands are 64 bit (Extended)
The icc record similar information when the operands are 32 bit.
3. (b) USB
• It was developed in 1955 by group of companies like
Compaq, HP, Intel, Lucent, Microsoft and Philips.
• The major goal of USB was
“To define an external expansion bus that makes attaching peripherals to computer as easy as
hooking up telephone on walljack.”
• USB 1.1 can operate at
1.5 Mbps (low speed) for mouse and KBD
and
12 Mbps (full speed) to support LAN’s and disk drives
• The next version
USB 2.0 has bandwidth of 40 to 480 Mbps so that it can be competitive with SCSI as well as
firewire, video conferencing cameras, scanners, CD writers etc.
• Motivation (to use USB)
1. USB uses single connector type to connect any device.
2. USB supports upto 127 devices per USB connection e.g. to one USB port we can connect
KBD, mouse, speakers using single cable type.
3. USB does not require memory or adder space. There is also no need for interrupt request
lines.
4. USB installation is very easy since it supports plug−and−play connectivity (doesn’t need
jumper or DIP switch setting)
5. Attaching USB device do not require to turn off computer and restarting after installing
the new device.
• Advantages of USB
1. Power distribution :
USB cable can provide +5V supply with 100 to 500 mA current. To avoid clutter of
power supplies. Device such as KBD, mouse, wireless LAN, FDD can be powered from
the cable.
2. Control peripheral :
The USB allow data transfer after in any direction.
3. Expandable through hub.
4. Power conservation : USB devices enter a suspended state if there is no activity on bus
for 3 ms.
5. Error detection and recovery: The USB uses CRC for checking to detect transmission
errors. In case of error the transaction is retried.
• USB uses NZI (Non return to zero inverted) encoding scheme to improve reliability of
transmission.
• Transfer types
USB support following 4 types of transfer
1. Interrupt: USB uses polling technique
2. Isochronous: For real time application i.e. transmission of data to speaker and reading
from CD-ROM.
3. Control: Used to configure and set up USB device.
4. Bulk: Devices that do not have specific transfer rate requirement use the bulk transfer.
E.g. transferring file to a printer.
Prelim Question Paper Solutions (11)
• USB Architecture
USB hardware consist of
(i) USB host controller: It initiates transactions on USB.
(ii) Root hub: It provides the connection points.
The host controllers are of two type:
1. OHC (Open Host Controller) : It is defined by Microsoft, Compaq.
2. UHC (Universal Host Controller) : It is defined by Intel.
The main difference between OHC and UHC is in scheduling above four transfer types :
The root hub is responsible for power distribution, enabling and disabling the port, device
recognition and status reporting when polled by the host software.
Expansion of USB using HUB :
Host
Root HUB
USB Device USB Device
HUB HUB
8-bits
8 bits 5 or 16 bits 3 bits
00000001
Sync
Packed ID Packet specific information CRC EOP
sequence
Memory Memory
PE PE PE PE PE
(a) A simple processing element (PE) (b) A systolic array processor
Although figure above illustrates a one-dimensional systolic array, two dimensional arrays
are not uncommon. Three-dimensional arrays are becoming more prevalent with the advances
in VLSI technology.
Systolic arrays employ a high degree of parallelism (through pipelining) and can sustain a
very high throughput. Connections are typically short and the design is simple and thus
highly scalable. They tend to be robust, highly compact, efficient and cheap to produce. On
the down side, they are highly specialized and thus inflexible as to the types and sizes of
problems they can solve.
A good example of using systolic arrays can be found in polynomial evaluation. To evaluate
the polynomial
y = a0 + a1x + a2x2 + ……… + akxk
A linear systolic array, in which the processors are arranged in pairs, can be used to evaluate
a polynomial.
Systolic arrays are typically used for repetitive tasks, including Fourier transformations,
image processing, data compression, shortest path problems, sorting, signal processing and
various matrix computations (such as inversion and multiplication). In short systolic array
computers are suitable for computational problems that lend themselves to a parallel solution
using a large number of simple processing elements.
Characteristics of Systolic Arrays :
− Synchronizations
− Modularity
− Regularity
− Locality
− Finite connection
− Parallel/pipeline
− Extendibility
1
4. (a) Efficiency (η) = .
r + (1 − r ) H
t A2 10−2
But, r= = = 100 × 103 = 0.1 × 106 sec.
t A1 10−7
(14) Vidyalankar : S.E. – COA
1
90% =
0.1 × 10 + (1 − 0.1× 106 ) × Η
6
4. (b) Main and the secondary memory form a two level hierarchy. This interaction is managed by
operating system. However so, it is not transparent to system software but somewhat transparent
to the user code. The term ‘virtual memory’ is applied when main and secondary memories
appears in user program like a single, large and directly addressing memory.
Three reasons for using virtual memory.
• To free user from the need to carry out storage reallocation and permit the efficient sharing of
available memory space by different users.
• To make the program independent of the configuration and capacity of the physical memory for
execution.
• To achieve very low cost per bit and low access time that are possible with memory
hierarchy.
The program is divided into number of blocks of virtual memory which is known as ‘virtual
address space’.
• A simple method for translating virtual address into physical addresses is to assume that all
programs and data are compared of fixed−length units called pages, each of which consists of
a block of words that occupy contiguous locations in the main memory.
• Pages commonly range from 2k to 16k bytes in length. They constitute the basic unit of
information that is moved between the main memory and the disk whenever the translation
mechanism determines that a move is required.
• A virtual memory address translation method based on the concept of fixed length pages is
shown in above figure. Each virtual address generated by the processor, whether it is for an
instruction fetch or an operand fetch / store operation is interpreted as virtual page number
(high order bits) followed by an offset. Low−order bits that specifies the location of a
particular byte (or word) within a page. Information about the main memory location of each
page is kept in a page table. This information includes the main memory address where the
page is stored and the current status of the page. An area in the main memory that can hold
one page is called a page frame.
The starting address of the page table is kept in a page table base register. By adding the
virtual page number to the contents of this register, the address of the corresponding entry in
the page table is obtained. The contents of this location give the starting address of the page
if that page currently resides in the main memory.
• Each entry in the page table also includes some control bits that describes the status of the page
while it is in the main memory. One bit indicates the validity of the page, i.e., whether the page is
actually loaded in the main memory. This bit allows the operating system to invalidate the page
without actually removing it. Another bit indicates whether the page has been modified during its
residency in the memory. Other control bits indicate various restrictions that may be imposed on
accessing the page.
Prelim Question Paper Solutions (15)
+
Page Table
Page frame
Control bits
in memory
4. (c) Booth’s algorithm is depicted as in following figure and can be described as follows :
1) Multiplier and Multiplicand are placed in Q and M registers respectively.
2) There is also a 1 bit register placed logically to the right of the least significant bit (Q0) of the
Q register and designated Q-1.
3) The result of the multiplication will appear in the A and Q register. A and Q−1 are initialized
to zero.
4) Control logic scans the bits of the multiplier one at a time. Now, as each bit is examined, the
bit to its right is also examined.
5) If the two bits are the same (1 − 1 or 0 − 0), then all of the bits of the A, Q and Q−1 registers
are shifted to the right 1 bit. If two bits differ, then the multiplicand is added to or subtracted
from the A register depending on whether the two bits are 0−1 or 1−0.
6) Following the addition or subtraction, the right shift occurs. In either case, the right shift is
such that the leftmost bit of A, namely An−1, not only shifts into An−2, but also remains in An−1.
This is required to preserve the sign of the number of A and Q.
Start
A ← 0 Q-1 ← 0
M ← Multiplicand
Q ← Multiplier
Count ← π
= 10 Q0+Q−1 = 01
A←A−M = 11 A←A+M
= 00
Arithmetic Shift
Right A, Q, Q−1
Count ← Count −1
No Yes
Count = 0? END
Algorithm
Case − I : If Qi = 0, Qi−1 = 1
then add M to partial product
Case − II : If Qi = 1, Qi−1 = 0
then subtract M from partial product
Case − III : If Qi = 0, Qi−1 = 0 OR Qi = 1, Qi−1 = 1
then, Rshift
Declare : A(7 : 0) Q(7 : 0), M(7 : 0), Count (3 : 0)
Bus : Inbus (7 : 0) Outbus (7 : 0)
Begin : A←0 Inbus ← Q(7 : 0)
Count ← n (No. of bits of number)
Input : M ← Inbus, Q ← Inbus
Loop : if (Q0, Q-1) = (00 V11)
then goto Rshift
if (Q0, Qi−1) = 01
then, A = A − M or
A (7 : 0) = A(7 : 0) + M(0 : 7)
if (Q0 , Qi−1) 10
then,
A (7 : 0) = A(7 : 0) − M(7 : 0)
Rshift : A(7 : 1) Q ≤ A . Q (6 : 0)
Test : Count = Count − 1
if Count = 0
then end
else goto loop P
End : stop
Prelim Question Paper Solutions (17)
The Nano computer language is believed to work well with the present day computer systems.
The primary use of this programming language is on graphics. With the Nano-X graphics system
you could create much fancier graphical programs. To make it work, you have to specifically
create the program with the Window, Unix or Macintosh interface in mind.
The Nano computer language primarily came from the nano-technology. Nano technology
refers to the fields of applied science that control matter on its molecular and atomic scale.
This program is easy to learn and apply. Texts can be typed immediately into the interface.
It is also simple to insert text into the program with the use of some editing configuration.
There is also nano editor software that you can use with the main program base so that
saving, cutting, pasting and searching becomes fairly straight forward.
Hardware Fault−Tolerance
The majority of fault−tolerant designs have been directed towards building computers that
automatically recover from random faults occurring in hardware components.
The techniques employed to do this generally involve partitioning a computing system into
modules that act as fault containment regions. Each module is backed up with protective
redundancy so that, if the module fails, others can assume its function. Special mechanisms are
added to detect errors and implement recovery.
(18) Vidyalankar : S.E. – COA
Software fault tolerance : Efforts to attain software that can tolerate software design faults
(programming errors) have made use of static and dynamic redundancy approaches similar to
those used for hardware faults. One such approach, N-version programming, uses static
redundancy in the form of independently written programs (versions) that perform the same
functions and their outputs are voted at special checkpoints. Here the data being voted may
not be exactly the same.
An alternative approach is based on the concept of recovery blocks. Programs are partitioned into
blocks and acceptance tests are executed after each block. If test fails, a redundant code block is
executed.
+ −
A+B B−4
*
(A + B) * (B − 4)
Data Flow Graph Computing N = (A + B) * (B − 4).
The data flow graph shown above is an example of a static dataflow architecture in which
the token flows through the graph in a staged pipelined fashion.
In dynamic dataflow architecture, tokens are tagged with context information and are stored in
a memory. During every clock cycle, memory is searched for the set of tokens necessary for a node
to fire. Nodes fire only when they find a complete set of input tokens within the same context. The
tokens propagate along the arcs.
Prelim Question Paper Solutions (19)
After presenting a valid address on the address bus, the CPU asserts two control signals to
identify the operation type :
(i) The IO/ memory signal is made low to indicate a memory operation.
(ii) The read /write line is also turned low to indicate a read operation.
(20) Vidyalankar : S.E. – COA
These two lines together indicate that the current bus transaction is a memory read operation.
The CPU samples the ready line at the end of T2. This line is used by slower memories to indicate
that they need more time. It asserts ready by making it low. The CPU then reads the data presented
by the memory on the data bus, removes the address and deactivates the IO/ memory and
read /write control signals.
Write Operation :
Write cycle is similar to read cycle. Since this is write operation, the read /write signal is held
high. The difference is that the CPU places data during the T2 clock cycle. As in read cycle, the
CPU removes the address and the IO/ memory and read /write control signals during the third
clock cycle.
Wait States :
The default timing allowed by the CPU is sometimes insufficient for a slow device to respond
e.g., in a memory read cycle, if we have a slow memory it may not be able to supply data during
the second clock cycle. Therefore, the CPU should not presume that whatever is present on the
data bus is actual data supplied by memory. Thus, the CPU always reads the value of the ready
line to see if the memory has actually placed the data on the bus. If this line is high, CPU waits
one more cycle and samples the ready line again. Once this line is low it reads the data and
terminates the read cycle.
Prelim Question Paper Solutions (21)
6. (a) Memory Characteristics : The properties to be considered when evaluating any memory technology
are :
i) Cost : The price should include the cost of information storage cells as well as the cost of
the peripheral equipment or access circuitry essential to the operation of memory.
cost = price of complete memory system / total bits of storage capacity.
ii) Access time : It is the time required to read or write a fixed amount of information. e.g. one word
from the memory. Access time depends upon the physical characteristics of the storage medium
and also on the types of access mechanism used. It is usually calculated from the time a read
request is received by the memory unit to the time a read request is made available to the memory
output terminals. The access time measured in words per second is another widely used
performance measure for storage devices. Thus, low cost and high access rates are desirable
memory characteristics.
(22) Vidyalankar : S.E. – COA
iii) Access modes: It is the order or sequence in which information can be accessed. Memory
can be accessed randomly or sequentially. In random access memories each storage location
can be accessed independently of the other locations whereas in serial access memory storage
locations can be accessed only in a certain predetermined sequence.
iv) Alterability: Memories whose contents cannot be altered on line are called Read Only
Memories (ROMs) Memories in which reading or writing can be done online are called read
write memories. All memories used for temporary purpose are read write memories.
v) Permanence of storage: The physical processes involved in storage are sometimes inherently
unstable, so that stored information may be lost over a period of time unless appropriate action is
taken. There are three important memory characteristics that can destroy information: destructive
readout, dynamic storage and volatility. In destructive readout, the memory contents are called as
the memory is read. Memories which require periodic refreshing are caused as dynamic memories.
Static memories do not require refreshing. If the contents of memory are lost in case of power
failure, the memory is termed as volatile memory.
vi) Cycle time and data transfer rate: The minimum time that must elapse between the
initiation of two different access by memory can be greater than access time. This loosely
defined term is called cycle time of the memory. It is generally convenient to assume that
cycle time is the time needed to complete any read or write operation in memory.
The maximum amount of data that can be transferred is 1/tm and is called data transfer rate.
The access time may be more important in measuring overall computer system performance
since it determines the length of time for which processor must wait until initiating a next
memory request.
vii) Physical characteristics: Many different physical properties of matter are used for
information storage. The most important properties used for this purpose are all classified as
electronic, magnetic, mechanical and optical. A factor determining the physical size of a
memory unit is the storage density measured in bits per unit area. In general, memories with
no moving parts have much higher reliability than memories such as magnetic disks which
involve considerable mechanical motion.
6. (b)
D4−D7 D0−D3
4 4
A0−A7
8 8
256 × 4 256 × 4
RD RD
(2) (1)
WR WR
EN EN
Step I: D0−D7
4
A0
A7 8
RD 256 × 8
WR
EN
enable
Prelim Question Paper Solutions (23)
256 × 8
(2)
EN
A8
256 × 8
(3)
3:8
A9
Decoder EN
A10
256 × 8
(8)
EN
• The O/S maintains a page table for each process. The page table shows the frame location for
each page of the process. Each logical address consists of a page number and a relative
address within the page. In paging, the logical to physical address translation is done by CPU
hardware.
• Now the CPU must know how to access the page table of the current process. Presented with
a logical address consisting of page number and relative address, the CPU uses the page table
to produce a physical address consisting of frame number and relative address as shown in
Fig. below. Logical Address
2 30 Physical Address
Page 0 13
14 30
Process A Page 1 14
Page table
Page 2 15
13
16
14
17
15 Page 3 18
18
19
• Hence, paging solves a lot of problems. Main memory is divided into many small equal size
frames. Each process is divided into frame size pages. Smaller process requires lower pages,
large processes require more. When a process is brought in, its pages are loaded into
available frames and a page table is set up.
• If the process tries to use a page that was not brought into memory. Access to a page marked invalid
causes a page fault swap. The paging hardware will notice that the invalid bit is set, causing a trap to
the operating system. This trap is the result of the operating system’s failure to bring the desired
page into memory.
Valid-Invalid bit
Frame
0 A 0
1 B 0 4 V 1
2 C 1 i 2
3 D 2 6 V 3
4 E 3 i 4 A
5 F 4 i 5
6 G 5 9 V 6 C
7 I 6 i 7
Logical 7 i 8
Memory
Page table 9
10 F
Fig. : Page table of demand paging
Physical Memory
I/O device
I/O device A B
Fig. : Programmed I/O with shared memory and I/O address space.
(26) Vidyalankar : S.E. – COA
I/O device
I/O device A B
Fig. : programmed I/O with separate memory and I/O address spaces (I/O−mapped I/O)