Professional Documents
Culture Documents
II Year II Sem , A.Y 2017-18, Reg: R16, Faculty Name: Mrs. K.Sowmya
UNIT I
Digital Systems and Binary Numbers
Syllabus:
Digital Systems, Binary Numbers, Binary Numbers, Octal and Hexadecimal Numbers, Complements of
Numbers, Complements of Numbers, Signed Binary Numbers, Arithmetic addition and subtraction
Introduction
INTRODUCTION of DIGITAL
Analog
An analog system has an infinite resolution (Continuous)
Like (old fashioned) radio dial
Work done is very little with analog
Eg: VGA, sound
Digital
A digital is a finite set of values (Discrete)
Like money
Cant get smaller than cents
Digital system is a system that manipulates discrete elements of information represented internally in
binary form
Analog system
The physical quantities or signals may vary continuously over a specified range.
Digital system
The physical quantities or signals can assume only discrete values.
Greater accuracy
Digital computer:
A digital computer stores data in terms of bits (0, 1) and proceeds in discrete steps from one state to the next.
In digital computers, even letters, words and whole texts are represented digitally.
Digital Logic is the basis of electronic systems, such as computers and cell phones. Digital Logic is rooted in
binary code; a series of 0s and 1s each having an opposite value. This system facilitates the design of
electronic circuits that convey information, including logic gates. Digital Logic facilitates computing,
robotics and other electronic applications.
Digital Logic designers build complex electronic components that use both electrical and computational
characteristics. These characteristics may involve power, current, logical function, protocol and user input.
Digital Logic Design is used to develop hardware, such as circuit boards and microchip processors. This
hardware processes user input, system protocol and other data in computers, navigational systems, cell
phones or other high-tech systems.
NUMBER SYSTEM
A number system has a radix (also called base) whose value is equal to the total number of symbols allowed in
the number system.
Example, for the decimal number system: Radix, r = 10, Digits allowed = 0,1, 2, 3, 4, 5, 6, 7, 8, 9
In positional number systems, a number is represented by a string of digits, where each digit position has an associated
weight.
D ip1n di ri
The general representation of an unsigned number D with whole and fraction portions of the number in a number
system with radix r is :
(D)r =
D ip1n di ri
Different Number System:
Decimal
Binary
Octal
Hexadecimal
Characteristics:
Eg : 24819.54
2 4 8 1 9 . 5 4
= 24819.54
MSB LSB
Octal Number System:
Characteristics:
= 510.625
84 83 82 81 80 8-1 8-2
MSB LSB
Characteristics:
1 E 5 . A
1E5.A = 1 x 162 + E x161 + 5x160+Ax16-1+Ax16-2
= 325.625
.
MSB LSB
Characteristics:
1 0 1 1 0 . 1 0 1
24 23 22 21 20 2-1 2-2
.
MSB LSB
Groups of bits
4 bits = Nibble
8 bits = Byte
1024 bytes= 210= 1Kilo Byte = 1KB
220= 210 x 210 = 210 Kilo Byte = 1Mega Bytes = 1MB
230= 210 x 220 = 210 Mega Byte = 1Giga Bytes = 1GB
240= 210 x 230 = 210 Giga Byte = 1Tera Bytes = 1TB
The Power of 2
40 30 20 12 11 10 9 8 7 6 5 4 3 2 1 0
9 8 7 6 5 4 3 2 1 0
240 230 220 212 211 210 2 2 2 2 2 2 2 2 2 2
1T 1G 1M 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
ANS: 48.4375
Converting from one number system to another number system is called code conversion
The general representation of a number D with radix r, whole and fraction portions of the number is :
(D)r =
The number above has p digits to the left of the radix point and n fraction digits to the right.
A digit in position i has as associated weight ri
The value of the number in base 10 is the sum of the digits multiplied by the associated weight ri
:
D in di r
p1 i
10
Converting binary to decimal:
Position: digit position is with respective to the point (.) , left of point begins from 0 to p-1and right of point
begins from -1.
Weight: weight of the position is (base) position 20..2p-1 from left of binary point and 2-1 from right of binary
point
Magnitude : Sum of Digit x Weight
Binary to decimal conversion Example
Eg : (10110.101)2
1 0 1 1 0 . 1 0 1
Position: digit position is with respective to the point (.) , left of point begins from 0 to p-1and right of point
begins from -1.
Weight: weight of the position is (base)position 80, ..8p-1 from left of octal point and 8-1 from right of octal point
Magnitude : Sum of Digit x Weight
Octal to decimal conversion Example
Eg : 716.5
7 1 6 . 5
Position: digit position is with respective to the point (.) , left of point begins from 0 to p-1and right of point
begins from -1.
Weight: weight of the position is (base) position 160..16p-1 from left of hexadecimal point and 16-1 from right
of hexadecimal point Magnitude : Sum of Digit x Weight
Hexadecimal to decimal conversion Example
Eg : (1E5.A)16
1 E 5 . A
Integer part conversion: Successive division of integer part i.e repeatedly divide the integer part of the decimal number
by r (base /radix of target number system) until the quotient is zero.
Collect all the remainders in reverse order to form the target radix number, i.e the first remainder is least significant
digit (LSD) and last remainder is most significant digit (MSD)
Fractional part conversion: Repeatedly multiply the fractional part with radix until the fractional part raches zero or
until sufficient no. of digits in the fractional part of a new radix number.
Each multiplication results in integer part and fractional part. Collect all the integer parts in the same order of
occurrence to represent the target radix fractional part of the number.
Decimal to binary:
Decimal to Octal
Decimal to Hexadecimal
(3315.3)10 = ( ? )16
Problem:
Convert the following Decimal to Binary and octal
189
512
777
999
121
456
As demonstrated by the table below, there is a direct correspondence between the binary system and the octal system,
with three binary digits corresponding to one octal digit. Likewise, four binary digits translate directly into one
hexadecimal digit.
00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Conversion from and to binary, octal and hexadecimal plays an important part in digital computers
Sine 23 = 8 and 24 = 16, i.e each octal digit corresponds to 3 binary digits and each hexadecimal digit corresponds to
4 binary digits
Binary Octal Conversion
8 = 23
Each group of 3 bits represents an octal digit and works for both binary to octal conversion and octal to binary
conversion
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
16 = 24
Each group of 4 bits represents an hexadecimal digit and works for both binary to hexadecimal conversion and
hexadecimal to binary conversion
Consider converting 101102 to base 16:
101102 = 00012 01102 = 116 616 = 1616
Notice that the leftmost two bits are padded with a 0 on the left in order to create a quartet triplet.
7 0111
Hex Binary
8 1000
0 0000
9 1001
1 0001
A 1010
2 0010
B 1011
3 0011
C 1100
4 0100
D 1101
5 0101
E 1110
6 0110
F 1111
Octal to Hexadecimal Conversion
Conversion from octal to hexadecimal is convenient if an intermediate binary conversion step is introduced.
First convert the octal number to binary and then convert binary number to hexadecimal number.
For hexadecimal to octal, first convert the hexadecimal number to binary and then convert binary number to octal
number.
Problems:
Convert the hexadecimal number 68BE to binary, and then convert it from binary to octal.
Convert the decimal number 431 to binary in two ways:
(a) Convert directly to binary;
(b) Convert first to hexadecimal and then from hexadecimal to binary.
Which method is faster?
Convert the following binary numbers to hexadecimal and 10 decimal: (a) 1.10010, (b) 110.010.
Explain why the decimal answer in (b) is 4 times that in (a).
What is the largest binary number that can be expressed with 14 bits?
What are the equivalent decimal and hexadecimal numbers?
Other Conversions
The conversion methods can be used to convert a number from any base to any other base, but it may not be very
intuitive to convert something like 513.03 in base 6 to base 7. As an aid in performing an unnatural conversion,
we can convert to the more familiar base 10 form as an intermediate step, and then continue the conversion from
base 10 to the target base. As a general rule, we use the polynomial method when converting into base 10, and we
use the remainder and multiplication methods when converting out of base 10.
CONVERSION SUMMARY TABLE
i n di 2
p 1 i zero at MSB if zero at MSB if
Binary -
required are required are take
take corresponding
corresponding hexadecimal digit
octal digit
Through Binary as
Octal intermediate step.
i n d i 8
p 1 i Convert each octal digit to 3 bit binary Convert to binary and
-
bits and group all them together at end group 4 bits are take
corresponding
Hexadecimal digit
Through
Binary as
intermediate
Hexadecimal Convert each hexadecimal digit to 4 step. Convert
d 16
p 1 i bit binary bits and group all them to binary and -
in i together at end group 3 bits
are take
corresponding
octal digit
Complements
Complements are used to simplify the logical manipulations and subtraction operations.
Given a number N in base r having n digits in integer and m digits in fractional part, the (r1)s
complement of N is defined as:
(rn r-m) N
Example for 6-digit integer decimal numbers:
9s complement is (rn r-m) N = (106100)N = (1061)N =999999N
9s complement of 546700 is 999999546700 = 453299
Example:
Find 9s complement of the decimal number 1234.765
Sol:
N = 1234.765, r=10
n=4(integer part), m=3 (fractional part)
(10n10-m)N
(10410-3)N
10000-0.001-1234.765
=8765.234
Sol:
N=101100.101, r=2
n=6(integer part), m=3 (fractional part)
(2n2-m)N
(262-3)N
1000000-0.0001-101100.101
111111.111-101100.101
=010011.010
A simple technique to obtain a diminished complement is to subtract each digit from the highest digit of the
number system.
For decimal numbers subtract each digit from 9 to get the complement of the number.
For binary numbers subtract each digit from 1 to get the complement of the number, in other words, invert
1 to 0 and 0 to 1, because 1-1 is 0 and 1-0 is 1.
Sol:
Using the technique, each digit must be subtracted from 9.
9-1=8
9-2=7
9-3=6
9-4=5
9-7=2
9-6=3
9-5=4
Therefore the 9s complement is 8765.234
Find 1s complement of 101100.101
Sol:
Using the technique, each digit must be subtracted from 1 or invert simply 1to 0 and 0 to 1.
Therefore the complement of 101100.101 becomes 010011.010
Given a number N in base r having n digits in integer part, the rs complement of N is defined as:
(rn ) N
Example for 6-digit integer decimal numbers:
10s complement is (rn ) N = (106)N = (106)N =1000000N
10s complement of 546700 is 1000000546700 = 453300
Example:
Find 10s complement of the decimal number 1234.765
Sol:
N = 1234.765, r=10
n=4(integer part)
(10n)N
(104)N
10000-1234.765
=8765.235
Sol:
N=101100.101, r=2
n=6(integer part),
(2n)N
(26)N
1000000-101100.101
=010011.011
A simple technique to obtain a radix complement is to subtract each digit from the highest digit of the
number system and add one to the total obtained result; i.e add one to (r-1)s complement, because radix
complement and diminished radix differ by one.
For decimal numbers subtract each digit from 9 to get the complement of the number and add one to the
total result.
For binary numbers scan from the least significant bit and copy till the first one encounters including the
first one, later invert 1 to 0 and 0 to 1.
Sol:
Using the technique, each digit must be subtracted from 9.
9-1=8
9-2=7
9-3=6
9-4=5
9-7=2
9-6=3
9-5=4
herefore the 9s complement is 8765.234
And add 1 to last digit therefore 10s complement becomes 8765.235
Sol:
Using the technique, scan from LSB and copy till first one encounter then invert 1 to 0 and 0 to 1.
Therefore the 2s complement of 101100.101 becomes 010011.01100
Problems
Problem:
Obtain the I' s and 2's complements of the following binary numbers:
(a) 10000000 (b) 00000000 (c) 11011010 (d) 0 11 10110 (e) 10000 101 (f) 1111 111 1.
Find the 9's and the 10's complement of the following decimal numbers:
(a) 52784630 (b) 63325600 (c) 25000.000 (d) 00000000.
Consider two positive numbers M and N, both of base r. Subtraction of the two numbers i.e M N is as
follows:
1. Add (minuend) M to the rs complement of (subtrahend) N: M + (rn N)
2. Check end carry resulted from step 1
a. If an end carry occurs, discard the end carry and the result is then M N.
b. If an end carry doesnt occur, take rs complement of the result of step1 and place negative
sign before the result.
Technically
The subtraction of two ndigit unsigned numbers M - N in base r can be done as follows:
1. Add the minuend M to the rs complement of the subtrahend N. Mathematically, M + (r n - N) = M - N + r n.
2. If M N, the sum will produce an end carry r n, which can be discarded; what is left is the result M - N.
3. If MN, the sum does not produce an end carry and is equal to r n - (N - M), which is the rs complement of
(N - M). To obtain the answer in a familiar form, take the rs complement of the sum and place a negative
sign in front.
Example:
Using 10s complement, subtract 72532 - 3250.
M = 72532
10s complement of N = + 96750
Sum = 169282
Answer = 69282
Note that M has five digits and N has only four digits. Both numbers must have the same number of digits,
so we write N as 03250. Taking the 10s complement of N produces a 9 in the most significant position. The
occurrence of the end carry signifies that M N and that the result is therefore positive.
Sum = 30718
There is no end carry. Therefore, the answer is -(10s complement of 30718) = -69282. Note that since 3250
< 72532, the result is negative. When subtracting with complements, we recognize the negative answer from
the absence of the end carry and the complemented result.
Problem
Subtract using the 10s complement (a) 4,637 - 2,579 (b) 125 - 1,800 (c) 2,043 - 4,361 (d) 1,631 - 745
Subtraction with complements is done with binary numbers in a similar manner, using the procedure
outlined previously.
Example 1.7
Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction
(a) X Y by using 2's complement.
There is no end carry. Therefore, the answer is Y X = (2's complement of 1101111) = 0010001
Problems:
Subtract using the 2s complement
(a) 10011 - 10010 (b) 100010 100110 (c) 1001 - 110101 (d) 101000 - 10101
Consider two positive numbers M and N, both of base r. Subtraction of the two numbers i.e M N is as
follows:
1. Add (minuend) M to the (r-1)s complement of (subtrahend) N: M + ((rn-1) N)
2. Check end carry resulted from step 1
a. If an end carry occurs, add the end carry to the result and the result is then M N.
b. If an end carry doesnt occur, take (r-1)s complement of the result of step1 and place
negative sign before the result.
Technically
The subtraction of two ndigit unsigned numbers M - N in base r can be done as follows:
1. Add the minuend M to the rs complement of the subtrahend N. Mathematically, M + ((r n-1) - N) = M - N -
1 + r n.
2. If M N, the sum will produce an end carry (r n-1), which one less than rn s complement of N; what is left
1 less than is the result M N, before the carry must be added to result.
3. If MN, the sum does not produce an end carry and is equal to r n-1 - (N - M), which is the (r-1)s
complement of (N - M). To obtain the answer in a familiar form, take the (r-1)s complement of the sum
and place a negative sign in front.
Example:
Using 9s complement, subtract 72532 - 3250.
M = 72532
9s complement of N = + 96749
Sum = 169281
69281
add end carry 1 = 1
Answer = 69282
Note that M has five digits and N has only four digits. Both numbers must have the same number of digits,
so we write N as 03250. Taking the 9s complement of N produces a 9 in the most significant position. The
occurrence of the end carry signifies that M N and that the result is therefore positive.
M = 03250
9s complement of N = + 27467
Sum = 30717
There is no end carry. Therefore, the answer is -(9s complement of 30717) = -69282. Note that since 3250
< 72532, the result is negative. When subtracting with complements, we recognize the negative answer from
the absence of the end carry and the complemented result.
Subtraction with complements is done with binary numbers in a similar manner, using the procedure
outlined previously.
Example 1.7
Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction
(a) X Y by using 1's complement.
There is no end carry. Therefore, the answer is Y X = (1's complement of 1101110) = 0010001
Signed Binary Numbers
Signed numbers are either positive or negative. The positive numbers are represented in only one way but the negative
numbers are represented in three ways. Signed numbers representation is divided into two parts, MSB is for sign of
the number and remaining are represent the number.
Three ways of representing Signed negative Binary Numbers
Signedmagnitude representation
signed1scomplement representation
signed2scomplement representation
Signedmagnitude representation: In signedmagnitude representation, MSB stands for sign i.e 1 is for
negative and 0 for positive and remaining digits are directly the magnitude of the number.
4 bit format 8 bit format
b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0
For example:
b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0
For example:
-6 in Signed ones complement representation -9 in signed ones complement representation
b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0
1 0 0 1 1 1 1 1 0 1 1 0
b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0
For example:
-6 in Signed twos complement representation -9 in signed twos complement representation
b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0
1 0 1 0 1 1 1 1 0 1 1 1
Examples:
Although there is only one way to represent +9, there are three different ways to represent -9 with eight bits:
Table 1.3 lists all possible four bit signed binary numbers for equivalent decimal numbers in the three
representations.
Note:
The positive numbers in all three representations are identical and have 0 in the leftmost position.
The signed 2s complement system has only one representation for 0, which is always positive.
The other two systems have either a positive 0 or a negative 0, something not encountered in
ordinary arithmetic.
All negative numbers have a 1 in the leftmost bit position; that is the way we distinguish them from
the positive numbers.
With four bits, in the signed magnitude and in the 1s complement representations, there are eight
positive numbers and eight negative numbers, including two zeros.
In the 2s complement representation, there are eight positive numbers, including one zero and eight
negative numbers.
For Arithmetic:
Signed Binary number Range of decimal numbers represented For 4 bits the possible range of
Representation (N is no. of bits) representation is
Signed Magnitude
-(2(N-1) -1) to +(2(N-1) -1) -7 to +7
Representation
signed1scomplement
-(2(N-1) -1) to +(2(N-1) -1) -7 to +7
representation
signed2scomplement
2(N-1) to +(2(N-1) -1) -8 to +7
representation
Arithmetic addition
The addition of two numbers in the signed-magnitude system follows the rules of ordinary
arithmetic. If the signs are the same, we add the two magnitudes and give the sum the
common sign. If the signs are different, we subtract the smaller magnitude from the larger
and give the difference the sign if the larger magnitude.
The addition of two signed binary numbers with negative numbers represented in signed-2's-
complement form is obtained from the addition of the two numbers, including their sign bits.
A carry out of the sign-bit position is discarded.
Example:
Arithmetic Subtraction
In 2s-complement form, take the 2s complement of the subtrahend (including the sign bit) and add it to the
minuend (including sign bit). A carry out of sign-bit position is discarded.
For example:
Problems:
The following decimal numbers are shown in signmagnitude form: +9,286 and +801. Convert them to
signed-10scomplement form and perform the following operations (note that the sum is +10,627 and
requires five digits and a sign).
(a) (+9,286) + (+801) (b) (+9,286) + (-801) (c) (-9,286) + (+801) (d) (-9,286) + (-801)
Convert decimal +49 and +29 to binary, using the signed2scomplement representation and enough digits
to accommodate the numbers. Then perform the binary equivalent of
(+29) + (-49), (-29) + (+49), and (-29) + (-49). Convert the answers back to decimal and verify that they are
correct.
If the numbers (+9,742) 10 and (+641) 10 are in signed magnitude format, their sum is (+10,383)10 and
requires five digits and a sign. Convert the numbers to signed-10scomplement form and find the following
sums:
(a) (+9,742) + (+641) (b) (+9,742) + (-641) (c) (-9,742) + (+641) (d) (-9,742) + (-641)
The digital data is represented, stored, transmitted and processed as group of binary digits (bits), called
as binary code.
A binary code may represent numbers, letters, words, as well as special characteristics and control
functions.
An n-bit binary code is a group of n bits that assumes up to 2n distinct combinations of 1s and 0s, with
each combination representing one element of the set that is being coded.
For example, using 2 bits, we can have 4 combination codes (00, 01, 10, 11). Using n bit binary code, we
have 2n codes ( 0 to 2n-1).
Although the minimum number of bits required to code 2n distinct quantities is n, there is no maximum
number of bits that may be used for a binary code.
There are various binary codes used for different purposes.
Classification of binary codes: (\Properties of binary codes)
ASCII EBCDIC
Excess-3 Gray
Weighted code: In a weighted code, each digit is assigned a specific weight according to its position.
There are several systems of weighted codes, like binary and BCD.
BCD codes:
Each decimal digit is represented using a 4-bit binary code.
A number with k decimal digits will require 4xk bits in BCD.
Decimal 396 is represented in BCD with 12bits as 0011 1001 0110, with each group of 4 bits
representing one decimal.
BCD can be represented using various weights like 8421,2421,84-2-1,5211,6311 etc.
Disadvantage: BCD number needs more bits than its equivalent binary value.
Advantage: Easy for conversions of decimal numbers to binary coded decimals and back to
decimal system
8421 :
Standard BCD code, often referred as BCD.
A decimal number in 8421 BCD is the same as its equivalent binary number only when the
number is between 0 and 9.
The binary combinations 1010 through 1111 are not used and have no meaning in this code.
Decimal 396 is represented in BCD with 12bits as 0011 1001 0110, with each group of 4 bits
representing one decimal
Disadvantage: BCD number needs more bits than its equivalent binary value.
Advantage: Easy for conversions of decimal numbers to binary coded decimals and back to
decimal system.
It is important to realize that BCD numbers are decimal numbers and not binary numbers,
although they use bits in their representation.
Example:
Consider decimal 185 and its corresponding value in BCD and binary:
Non-Weighted code: In a non-weighted code, digits are assigned codes irrespective of the weights.
They are few such codes like gray code and excess-3 code
Excess-3 code:
Excess-3 is a non-weighted code in which each coded combination is obtained from the
corresponding binary value plus 3; i.e add 0011.
Excess-3 self- complementing code, sequential and non-weighted.
Eg: 6 in BCD is 0110 and in excess-3 it is 1001
It is not limited to 0-9
Gray code:
The output data of many physical systems are quantities that are continuous and need to be sent to
digital systems as input. These data must be converted into digital form before they are applied
to a digital system. Gary code is convenient to use.
The advantage of the Gary code over the straight binary number sequence is that only
one bit in the code group changes in going from one number to the next. For example, in
going from 7 to 8, the Gary code changes from 0100 to 1100. Only the first bit changes, from
0 to 1; the other three bits remain the same. By contrast, with binary numbers the change
from 7 to 8 will be from 0111 to 1000, which causes all four bits to change values.
It is not limited to 0-9
Any two consequent decimal numbers differ by only one bit in gray code
The Gary code is used in applications in which the normal sequence of binary numbers
generated by the hardware that may produce an error or ambiguity during the transition from
one number to the next.
The Gary code eliminates erroneous transmission, since only one bit changes its value during
any transition between two numbers.
A typical application of the Gary code is the representation of analog data by a continuous
change in the angular position of a shaft.
GRAY CODE IS ALSO CALLED AS REFLECTION CODE OR MIRROR CODE,
because it can generated by reflection.
It is a cyclic code
It is not useful for arithmetic operations
Main advantages of gray code are:
The advantage is that only bit in the code group changes in going from one number to
the next.
Error detection.
Representation of analog data.
Low power design.
1. Take the MSB as it, MSB of binary code is same as MSB of gray.
2. Start from MSB and perform X-OR with adjacent and take result as target adjacent binary bit of
MSB, continue till LSB.
Self-complementing code: is a binary code in which the complement is formed by taking the 1's
complement
Examples : Excess-3 and 2421
9 in Excess-3 is 1100 and its complement is 0 i.e 0011
9 in 2421 is 1111 and its complement is 0 i.e 0000
6 in Excess-3 is 1001 and its complement is 3 i.e 0110
6 in 2421 is 1100 or 0110 and its complement is 3 i.e for 0011 or 1001 respectively
6 in 8421 is 0110 and its complement is 3 i.e 0011 and is not self-complementing code
Alphanumeric Codes:
These codes are used to represent different alphabets, numbers, symbols and various instructions.
To detect errors in data communication and processing, an eighth bit is sometimes added to the ASCII
character (before MSB) to indicate its parity.
Problems:
The following is a string of ASCII characters whose bit patterns have been converted into hexadecimal for
compactness: 73 F4 E5 76 E5 4A EF 62 73. Of the eight bits in each pair of digits, the leftmost is a parity
bit. The remaining bits are the ASCII code.
Convert the string to bit form and decode the ASCII.
Determine the parity used: odd or even?
Part A
1. a) What are the characteristics of 2s complement numbers? (3M)
2. a) How are negative numbers represented? (2M)
3. a) What do you mean by end around carry? When does it come into picture? (2M)
4. a) Why is the binary number system used in digital systems? (2M)
Part B
1.a) The solution to the quadratic equation x2 11x + 22 = 0 is x = 3 and x = 6. What is the base
of numbers.
b) Using 10s complement, subtract
i) 7253210-325010 ii) 325010-7253210. What do you infer from the results. (8M+8M)
2. a) What is the advantage of 1s and 2s complement in computers. Represent +45 and -45 in
sign-magnitude, sign-1s complement and sign-2s complement representation.
b) Explain about Weighted and non-weighted codes (8M+8M)
3. a) The binary numbers listed have a sign bit in the left most position and, if negative numbers
are in 2s complement form. Perform the arithmetic operations indicated and verify the
answers.
i) 101011 + 111000 ii) 001110 + 110010 iii) 111001 001010 iv) 101011 100110
b) Explain about Weighted and non-weighted codes (8M+8M)
4. a) Explain how 1's complement and 2's complement of a binary number is obtained? Illustrate
by an example.
b) What is gray code? What are the rules to construct gray code? Develop the 4 bit gray code
for the decimal 0 to 15. (8M+8M)
II B. Tech I Semester Supplementary Examinations, June 2015
PART A
a) (25.75)10 to binary number 4M
a) Convert the decimal number 46 to binary number system also explain the steps of conversion 4M
a) Decimal number 86 to octal number system also explain the steps of conversion (4M)
a) Convert 6ABC.2A to decimal number system 4M
PART B
1. a) Perform the following arithmetic operation using ls complement method : i) Add (-19)10 and (29)
10 ii) Add (21)10 and (37)10 8M
b) The Hamming code 010110110 is received at the receiving end. Correct the received data if there
is any error. 8M
2. a) Perform the following using BCD arithmetic. i)126310 + 968710 ii)767210 + 337810 8M
b) Perform the following subtraction: i) (11010)2 (10000)2 using 1s complement ii) (1000100)2 -
(1010100)2 using 2s complement 8M
3. a) Briefly explain error detecting and error correcting codes with examples. (8M)
b) Convert the following to Decimal and then to Hexadecimal. i) 12678 ii) 110111012 iii) 78610 (8M)
4. a) Using 2s complement perform the following: i) (42)10 - (68)10 ii) (78)16 (56)16 8M
b) Perform each of the following decimal subtraction in excess-3 code i) 29 14 ii) 205 196
iii) 471 352 8M
II B. Tech I Semester Regular/Supplementary Examinations, Dec 2015.
Part A
Convert (615.25)8 to its hexadecimal equivalent (set1 4 M)
Convert (12.125)10 into binary (Set 2 3M)
Perform (28)10 (15)10 using 6 bit 2s complement representation. (Set3-4M)
Perform subtraction (1110)2- (1010)2 using 2 complement method. (3M)
Part B
SET1
a)Find the difference of (3250-72546)10 by using 10s complement. (8M)
b) Perform the following: i) 11010 1101
ii) 101011 100110 (using 2s complement) (8M)
SET2
a) Add and subtract in binary.
i) 1111 and 1010 ii) 110110 and 11101
iii) 100100 and 10110 iv) 1101001 and 11011
(8M)
b) Explain any two binary weighted codes with example (8M)
SET 3
a) Convert the decimal numbers 250.5, 12.0625, 673.23 to binary, base 8 and base 16. [9M]
b) Explain any two non-weighted codes with example [7M]
a) Subtract the following numbers using 9s complement and 10s complement.
i) 5250 321
ii) 753 864
iii) 3570 2100
iv) 20 100 (8M)
b) Convert the following:
i) (163.789)10 = ( )8
ii) (101101110001.00101)2 = ( )8
iii) (292)16 = ( )2 (8M)
II B. Tech I Semester Supplementary Examinations, June 2016