You are on page 1of 17

Gokaraju Rangaraju Institute of Engineering and Technology

Department of Computer Science and Engineering


Year/Semester : II / II Academic year: 2015-16

SUB:CO Tutorial Sheet: I-1

SHORT ANSWER QUESTIONS

1. Convert the following decimal numbers to binary


2. Obtain the 10's complement of the following six digit decimal numbers:
3. Perform the subtraction with the following unsigned decimal numbers by taking the 10'
compliment of the subtrahend:
4. Perform the arithmetic operations in binary using signed 2's complement representation
for negative numbers.
5. The gray code is sometimes called a reflected code because the bit values are reflected
on both sides of any 2^n value
6. Show that the block diagram of the hardware that implements the following register
transfer statement:
7. Draw a diagram of bus system ,use the three state buffers and a decoder instead of the
multiplexers

8. Draw the block diagram for the hardware that implements the following statements: AR
<- AR+BR where AR and BR are two n bit registers and x,y,z are control
variables.Include the logic gates for the control function

9. Design an arithmetic circuit with one selection variable S and two n bit data inputs A and
B.The circuit generates the following arithmetic operations in conjunction with the input
carry Cin. Draw the logic diagrams for the 2 stages

10. Starting from an initial value of R =11011101,determine the sequence of binary values in
R after a logical shift left ,followed by a circular shift right ,followed by a logical shift
right and a circular shift left 11011101

LONG ANSWERS
1. Write and explain various computer types.

2. Explain functional units of computer in detail

3. Explain the following fixed point representations along with their ranges

4. Explain the following floating point representations along with their ranges (IEEE 754
for single precision and double precision formats)

5. Explain error detection codes using parity bits(even and odd)


Gokaraju Rangaraju Institute of Engineering and Technology
Department of Computer Science and Engineering
Year/Semester : II / II Academic year: 2015-16

SUB:CO Tutorial Sheet: I-1

SHORT ANSWER QUESTIONS

11. Convert the following decimal numbers to binary


(1231)10 = 1024 + 128 + 64 + 15 = 210 + 27+ 26 + 23 + 22 + 2 + 1 = (10011001111)2
(673)10 = 512 + 128 + 32 + 1 = 29 + 27 + 25 + 1 = (1010100001)2
(1998)10 = 1024 + 512 + 256 + 128 + 64 + 8 + 4+2
= 210 + 29 + 28 + 27 + 26 + 23 + 22 + 21 = (11111001110)2

12. Obtain the 10's complement of the following six digit decimal numbers:
123900; 090657; 100000; 000000
876100; 909343; 900000; 000000
13. Perform the subtraction with the following unsigned decimal numbers by taking the
10' compliment of the subtrahend:

(a) 5250 b) 1753 (c) 020 (d) 1200


+ 8679 + 1360 + 900 + 9750
1) 3929 0 ) 3113 0) 920 1)0950
= 10s complement
6887 080
14. Perform the arithmetic operations in binary using signed 2's complement
representation for negative numbers.
01 last two carries 1 0

+ 70 01000110 70 10111010
+ 80 01010000 80 10110000
+150 10010110 150 01101010

greater negative less than positive
Than 128
+127

15. The gray code is sometimes called a reflected code because the bit values are
reflected on both sides of any 2^n value .Obtain :
a)Gray code numbers for 16b through 31
Decimal Gray code
16 11000
17 11001
18 11011
19 11010
20 11110
21 11111
22 11101
23 11100
24 10100
25 10101
26 10111
27 10110
28 10010
29 10011
30 10001
31 10000
b)The excess -3 gray code for decimals 10 to 19

Decimal Exess-3 Gray


9 0010 1010
10 0110 1010
11 0110 1110
12 0110 1111
13 0110 1101
14 0110 1100
15 0110 0100
16 0110 0101
17 0110 0111
18 0110 0110
19 0110 0010
20 0111 0010

16. Show that the block diagram of the hardware that implements the following
register transfer statement:
Yt2: R2 <- R1 , R1 <- R2

17. Draw a diagram of bus system ,use the three state buffers and a decoder instead of
the multiplexers
18. Draw the block diagram for the hardware that implements the following
statements: AR <- AR+BR where AR and BR are two n bit registers and x,y,z are
control variables.Include the logic gates for the control function

19. Design an arithmetic circuit with one selection variable S and two n bit data inputs
A and B.The circuit generates the following arithmetic operations in conjunction
with the input carry Cin. Draw the logic diagrams for the 2 stages
Logical shift left: 10111010
S Cin=0 Cin=1
Circular shift
0 right: D=A+B(add) 01011101 D=A+1(increment)
1 LogicalD=A-1(decrement)
shift D=A+B'+1(subtract)
right: 00101110

CinCircular
X shift left:
Y 01011100
S
0 0 A B (A + B)
0 1 A 0 (A + 1)
1 0 Logical
A shift left:
1 10111010
(A 1)
1 1 Circular
A shift -B (A B)
right: 01011101
Logical shift
right: 00101110
Circular shift left: 01011100

20. Starting from an initial value of R =11011101,determine the sequence of binary


values in R after a logical shift left ,followed by a circular shift right ,followed by a
logical shift right and a circular shift left 11011101

R = 11011101

Long Answers

6. Write and explain various computer types.

A computer is a fast electronic calculating machine that accepts digitized input information,
processes it according to a list of internally stored instructions and produces the resulting
output information. The list of instruction is called a computer program, and the internal
storage is called computer memory
Many types of computers exists that differ widely in size, cost, computational power and
intended use.
a) Personal computers: The most common computer is the personal computer ,which has
found wide use in homes ,schools and business offices. It is themost common form of
desktops.

b) Desktop computers: It has processing and storage units ,visual display and audio output
units and a keyboard that can all be located easily on a home or office desk.

c) Portable notebook computers: These are a compact version of the personal computer with
all of these components packaged in to a singleunit the size of a brief case.

d) Workstation: A powerful, single-user computer. A workstation is like a personal computer,


but it has a more powerful microprocessor and, in general, a higher-quality monitor.

e) Minicomputer: A multi-user computer capable of supporting up to hundreds of users


simultaneously.

f) Mainframe: A powerful multi-user computer capable of supporting many hundreds or


thousands of users simultaneously.

g) Supercomputer: An extremely fast computer that can perform hundreds of millions of


instructions per second.

h) Laptop computer A small, portable computer -- small enough that it can sit on your lap.
Nowadays, laptop computers are more frequently called notebook computers.

i) Subnotebook computer A portable computer that is slightly lighter and smaller than a full-
sized notebook computer. Typically, subnotebook computers have a smaller keyboard and
screen, but are otherwise equivalent to notebook computers.

j) Hand-held computer A portable computer that is small enough to be held in ones hand.
Although extremely convenient to carry, handheld computers have not replaced notebook
computers because of their small keyboards and screens.

k) Personal Digital Assistants (PDAs) are tightly integrated computers that often use flash
memory instead of a hard drive for storage. These computers usually do not have
keyboards but rely on touchscreen technology for user input. PDAs are typically smaller
than a paperback novel, very lightweight with a reasonable battery life. A slightly larger
and heavier version of the PDA is the handheld computer.

l) The latest trend in computing is wearable computers. Essentially, common computer


applications (e-mail, database, multimedia, calendar/scheduler) are integrated into watches,
cell phones, visors and even clothing! For more information see these articles on computer
clothing, smart watches and fabric PCs.

7. Explain functional units of computer in detail

Input Unit:- Computers need to receive data and instruction in order to solve any problem.
Therefore we need to input the data and instructions into the computers. The input unit
consists of one or more input devices. Keyboard is the one of the most commonly used
input device. Other commonly used input devices are the mouse, floppy disk drive,
magnetic tape, etc. All the input devices perform the following functions.
Storage Unit:- The storage unit of the computer holds data and instructions that are entered
through the input unit, before they are processed. It preserves the intermediate and final
results before these are sent to the output devices. It also saves the data for the later use.
The various storage devices of a computer system are divided into two categories.

1. Primary Storage: Stores and provides very fast. This memory is generally used to hold the
program being currently executed in the computer, the data being received from the input
unit, the intermediate and final results of the program. The primary memory is temporary
in nature. The data is lost, when the computer is switched off. In order to store the data
permanently, the data has to be transferred to the secondary memory.

2. Secondary Storage: Secondary storage is used like an archive. It stores several programs,
documents, data bases etc. The programs that you run on the computer are first
transferred to the primary memory before it is actually run. Whenever the results are
saved, again they get stored in the secondary memory. The secondary memory is slower
and cheaper than the primary memory. Some of the commonly used secondary memory
devices are Hard disk, CD, etc.,

Output Unit: The output unit of a computer provides the information and results of a
computation to outside world. Printers, Visual Display Unit (VDU) are the commonly
used output devices. Other commonly used output devices are floppy disk drive, hard
disk drive, and magnetic tape drive.

Arithmetic Logical Unit (ALU): All calculations are performed in the Arithmetic Logic
Unit (ALU) of the computer. It also does comparison and takes decision. The ALU can
perform basic operations such as addition, subtraction, multiplication, division, etc and
does logic operations
Control Unit :- The control unit (often called a control system or central controller) manages
the computers various components; it reads and interprets (decodes) the program
instructions, transforming them into a series of control signals which activate other parts
of the computer. Control systems in advanced computers may change the order of some
instructions so as to improve performance.

8. Explain the following fixed point representations along with their ranges

Fixed Representation: Its the representation for integers only where the decimal point is
always fixed. i.e at the end of rightmost point. it can be again represented in two ways.

1. Sign and Magnitude Representation

In this system, he most significant (leftmost) bit in the word as a sign bit. If the sign bit is 0,
the number is positive; if the sign bit is 1, the number is negative. The simplest form of
representing sign bit is the sign magnitude representation. One of the draw back for sign
magnitude number is addition and subtraction need to consider both sign of the numbers
and their relative magnitude. Another drawback is there are two representation for
0(Zero) i.e +0 and -0.

2. Ones Complement (1s) Representation

In this representation negative values are obtained by complementing each bit of the
corresponding positive number. For example 1s complement of 0101 is 1010 . The
process of forming the 1s complement of a given number is equivalent to subtracting that
number from 2n -1 i.e from 1111 for 4 bit number.
3. Twos Complement (2s) Representation

Forming the 2s complement of a number is done by subtracting that number from 2n . So 2s


complement of a number is obtained by adding 1 to 1s complement of that number. Ex:
2s complement of 0101 is 1010 +1 = 1011

4. Unsigned representation

5. Biased representation

9. Explain the following floating point representations along with their ranges (IEEE
754 for single precision and double precision formats)

1. Single Precision Representation:

32-bit representation divided into 3 fields: Sign: 1-bit,

Exponent: 8-bits, Mantissa: 23-bits

2. Double Precision Representation:

64-bit representation divided into 3 fields: Sign: 1-bit, Exponent: 11-bits,


Mantissa: 52-bits

Exponent: Excess representation: actual exponent + Bias, Ensures exponent is unsigned

Single precision: Bias = 127


Double precision: Bias = 1203
(Exponents 00000000 and 11111111 are
Single Precision: reserved).

Smallest value:

Exponent: actual
00000001 exponent = 1 127 = 126
Fraction: 000 = 1.0 2
00 significand = 1.0 126

Largest value:
Exponent: actual = 254
11111110 exponent 127 = +127
= 2.0
Fraction: 11111 significand 2.0 2+127

Double-Precision Range: ( Exponents 000000 and 111111 are reserved )

Smallest value:
Exponent:
00000000001 Actual exponent = 1 1023 = 1022

Fraction: 00000 significand = 1.0 1.0 21022


Largest value:
Exponent: = 2046 1023 = +1023
11111111110 Actual exponent
Exponent:
11111111110 Actual exponent = 2046 1023 = +1023

Fraction: 11111 significand 2.0 2.0 2+1023

The normalized significand is 1.m (binary dot). The binary point is before bit-22 and the 1
(one) is not present explicitly.

* The sign bit s = 1 for a ve number and zero (0) for a +ve number.
* The value of a normalized number is:

s is sign bit (31st bit), e is the exponent is 8 bits (30-23 bits) and m is the mantissa
(significand or fraction) (22-0 bits).

Bias: The sign bit is removed from being a separate entity The valid range of the exponents is
1 to 254 (if e is treated as an unsigned number).

The actual exponent is biased by 127 to get e i.e. the actual value of the exponent is e 127.

This gives the range: 21127 = 2126 to 2254127 = 2127.

Example 1: Binary to decimal:

Consider the following 32-bit pattern


1 1011 0110 011 0000 0000 0000 0000 0000
The value is (1)1 1.011 21011011001111111
1.375 255
49539595901075456.0
4.9539595901075456 1016

Note: (.011)2 = 0*2-1 + 1 * 2-2 + 1 * 2-4 = 0*.5 + 1 * .25 + 1 * .125 = (.375)10

Example 02:

Consider the decimal number: +105.625. The equivalent binary representation is

+1101001.101
+1.101001101 26
+1.101001101 2133127
10000101 01111111
+1.101001101 2

In IEEE 754 format:


0 1000 0101 101 0011 0100 0000 0000 0000

Example 03:
Consider the decimal number: +2.7. The equivalent binary representation is

+10.10 1100 1100 1100


= +1.010 1100 1100 21
= +1.010 1100 1100 2128127
= +1.010 1100 2 1000000001111111

In IEEE 754 format (approximate):

0 1000 0000 010 1100 1100 1100 1100 1101

10. Explain error detection codes using parity bits(even and odd)

Binary information transmitted through some form of communication medium is subject to


external noise that could change bits from 1 to 0, and vice versa. Even though the codes
presented so far are adequate for the representation of the digits and characters, they are very
sensitive to transmission errors. Two types of codes that are used for single error detection
and correction are error detection codes and error correction codes. If errors

You might also like