0% found this document useful (0 votes)
20 views20 pages

CH-1 English Final

The document provides an overview of Digital Logic Design, focusing on the number system and the differences between analog and digital systems. It explains the components of a digital computer, including the CPU, input/output devices, and memory, while also detailing various number systems such as decimal, binary, octal, and hexadecimal. Additionally, it covers concepts like 1's and 2's complements, as well as 9's and 10's complements, along with methods for converting binary to decimal.

Uploaded by

kanabarshiv21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views20 pages

CH-1 English Final

The document provides an overview of Digital Logic Design, focusing on the number system and the differences between analog and digital systems. It explains the components of a digital computer, including the CPU, input/output devices, and memory, while also detailing various number systems such as decimal, binary, octal, and hexadecimal. Additionally, it covers concepts like 1's and 2's complements, as well as 9's and 10's complements, along with methods for converting binary to decimal.

Uploaded by

kanabarshiv21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

School of Diploma Studies

Faculty of Engineering and Technology

Computer Engineering
Department

Semester - 2

Digital Logic Design


(24DIEE202)

Unit – 1 Number System

Mr. Punit C. Trivedi


Lecturer (DCE)

Yogidham Gurukul, Kalawad Road, Rajkot - 360005


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

Q - 1 Introduction of analog and digital system.

 Electronics can be divided into analog and digital. Today's wireless era is completely digital. Our
communication system is digital. The era of analog electronics is over today. However, the output to
humans is always analog. For example, the output from the speaker of a mobile phone is analog.
Because it is for human ears to hear.
 Analog System:
 Analog electronics is an electronics system that works with continuously changing signals.
 An analog system uses a specific component to exchange information. As, a thermometer is used to
measure the temperature of the atmosphere. But its exact number is calibrated according to the
compression expansion of the mercury in it.
 An analog system is a combination of analog media and machines. Analog devices record, measure
and reproduce continuous signals.
 Example: Analog TV, Barometer, Analog synthesizer.
 Digital System:
 Digital electronics is an electronics system that works with continuously varying signals. A digital
system shows direct output from digital signals.
 Following are the features of digital electronics.
o Discontinuous in the time domain.
o Has high accuracy.
o An IC based structure.
o It is light in weight.
o Has abundant digital memory.
o Compatible with wireless standards.
 Example: LCD, LED or Smart TV, TV set up box.

Q - 2 Explain block diagram of digital computer.

 Mainly computer system consists of three parts that are :


 Central processing unit (CPU)
 Input Devices
 Output Devices.

DLD (24DIEE202) Page 1


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 Input:
 This is the process of entering data and programs in to the computer system.
 keyboard, mouse, joy stick , light pen , track ball, scanner ,magnetic ink card reader(MICR), optical
character reader(OCR), bar code reader, optical mark reader(OMR)
 The Processor Unit (CPU):
 It is the brain of the computer system. All major calculation and comparisons are made inside the
CPU and it is also responsible for activation and controlling the operation of other unit. This unit
consists of two major components that are arithmetic logic unit (ALU) and control unit (CU).
 The Central Processing Unit (CPU) is divided into two parts:
o Arithmetic logic unit (ALU)
o Control unit (CU).
 The set of instruction is in the form of raw data
 Arithmetic Logic Unit (ALU):
 Here arithmetic logic unit performs all arithmetic operations such as addition, subtraction,
multiplication and division. It also uses logic operation for comparison.
 Control Unit (CU):
 The control unit of a CPU controls the entire operation of the computer. It also controls all devices
such as memory, input/output devices connected to the CPU.
 CU fetches instructions from memory, decodes the instruction, interprets the instruction to know
what the task are to be performed and sends
 Memory Unit:
 Memory unit is an essential component of a digital computer. It is where all data intermediate and
find results are stored. The data read from the main storage or input units are transferred to the
computer's memory where they are available for processing. This memory unit is used to hold the
instructions to be executed and data to be processes.
 Example: Magnetic Disk, DVD.
 Output:
 This is the process of producing results from the data for getting useful information.
 Monitors, graphic plotter, printer.

DLD (24DIEE202) Page 2


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

Fig 1.1 Block diagram of computer system

Q - 3 What is digital system? Explain characteristics and advantages of digital system.

 Digital system:
 Digital systems are designed to store, process, and communicate information in digital form. The
input and output of this system is two binary values which is 0 and 1. Examples of digital systems
are mobile phones, radio, megaphones and many more.
Or
 A digital system is an interconnection of digital modules and it is system that manipulates discrete
elements of information that represented internally in the binary form.

 Characteristics of digital system:


 Digital systems manipulate discrete elements of information.
 The discrete elements are 10 decimal digital digits, 26 letters or alphabets and other symbols.
 Digital systems use physical quantities called signal to represent discrete elements.
 A signal in digital system represents one binary digit, called a bit. The bit has a value 0 or 1.
 Discrete elements of information are represented with group of bites called binary codes.

 Advantages of digital system:


 Easy to design
 Exact result
 Flexibility to design
 Easy to function

DLD (24DIEE202) Page 3


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 Very fast speed


 Low cost
 Easy to program

Q - 4 What is number system? Explain Types of number system in detail.

 Number system:
 Number systems are the technique to represent numbers in the computer system architecture,
every value that you are saving or getting into/from computer memory has a defined number
system.
 Computer architecture supports following number systems.
o Decimal number system
o Binary number system
o Octal number system
o Hexadecimal (hex) number system
 Decimal number system:
 Decimal number system has only ten (10) digits from 0 to 9.
 These digits are 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9.
 The base of decimal number system is 10, because it has only 10 digits.
 General form: The decimal number system is expressed as a power of 10.

……. 103 102 101 100 10-1 10-2 10-3 ……..


.

 Example: Represent decimal number (1234.65)10 into base method.

(1 x 103)+ (2 x 102) + (3 x 101) + (4 x l00) + (6 x 10-1) + (5 x l0-2)


(1 x 1000)+ (2 x 100) + (3 x 10) + (4 x l) + (6 x 0.1) + (5 x 0.0l)
1000 + 200 + 30 + 4+0.6+0.05
1234.65
 Binary number system:
 Binary Number System consists of two digits only i.e. 0 & 1.
 Every number (value) represents with 0 and 1 in this number system.
 The base of binary number system is 2, because it has only two digits.
 Binary digits are called as Bits; it is formed from two words Binary and Digits.

DLD (24DIEE202) Page 4


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 General form: The binary number system is expressed as a power of 2.

……. 23 22 21 20 2-1 2-2 2-3 ……..


8 4 2 1 . 0.5 0.25 0.125

 Example: Represent binary number (10101)2 into its decimal equivalent.

Step Binary Number Decimal Number


Step 1 101012 ((1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x 20))10
Step 2 101012 (16 + 0 + 4 + 0 + 1)10
Step 3 101012 2110

 Octal number system:


 Octal number system has only eight (8) digits from 0 to 7.
 Every number (value) represents with 0,1,2,3,4,5,6 and 7 in this number system.
 The base of octal number system is 8, because it has only 8 digits.
 General form: The octal number system is expressed as a power of 8.

……. 83 82 81 80 8-1 8-2 8-3 ……..


521 64 8 1 . 0.125 0.0157 0.00196

 Example: Represent binary number (12570)8 into its decimal equivalent.

Step Octal Number Decimal Number


Step 1 125708 ((1 x 84) + (2 x 83)
+ (5 x 82) + (7 x 81) + (0 x 80))10
Step 2 125708 (4096 + 1024 + 320 + 56 + 0)10
Step 3 125708 549610

 Hexadecimal number system:


 A Hexadecimal number system has sixteen (16) alphanumeric values from 0 to 9 and A to F.
 Every number (value) represents with 0,1,2,3,4,5,6, 7,8,9,A,B,C,D,E and F in this number system.
 The base of hexadecimal number system is 16, because it has 16 alphanumeric values.
 Here A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
 General form: The hexadecimal number system is expressed as a power of 16.

……. 163 162 161 160 16-1 16-2 16-3 ……..


4096 256 16 1 . 0.0625 0.003907 0.000244

DLD (24DIEE202) Page 5


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 Example: Represent binary number (19FDE)16 into its decimal equivalent.

Step Binary Number Decimal Number

Step 1 19FDE16 ((1 x 164) + (9 x 163) + (F x 162) + (D x 161) + (E x 160))10

Step 2 19FDE16 ((1 x 164) + (9 x 163) + (15 x 162) + (13 x 161) + (14 x 160))10

Step 3 19FDE16 (65536+ 36864 + 3840 + 208 + 14)10

Step 4 19FDE16 10646210

 Table of the Numbers Systems with Base, Used Digits, Representation:

Number system Base Used digits Example


Binary 2 0,1 (11110000)2
Octal 8 0,1,2,3,4,5,6,7 (360)8
Decimal 10 0,1,2,3,4,5,6,7,8,9 (240)10
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F (F0)16

Q - 5 Relation between number system.

DLD (24DIEE202) Page 6


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

Q - 6 Explain 1’s complement and 2’s complements in detail.


 1’s complement:
 for all bits in a byte are inverted by changing each 1 to 0 and each 0 to 1, we have formed the one’s
complement of the number.
 Example:
 Original One's Complement
 -------------------------------
 10011001 --> 01100110
 10000001 --> 01111110
 11110000 --> 00001111
 11111111 --> 00000000
 2’s complement:
 2’s complement of a binary number is 1 added to the 1’s complement of the binary number.
 The two’s complement is a method for representing positive and negative integer values in binary.
The useful part of two’s complement is that it automatically includes the sign bit.
 Example:
 Begin with the original binary value
 10011001 Original byte
 Find the one's complement
 01100110 One's complement
 Add 1 to the one's complement
 01100110 One's complement
 + 1 Add 1
 -----------------
 01100111 <--- Two's complement

DLD (24DIEE202) Page 7


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

Q - 7 Explain 9’s complement and 10’s complement in detail.

 The 9’s complement :


 The 9’s complement of a number can be obtained by subtracting every digit of a number by 9.
Consider some numbers such as 6, 27, 234, 672 and the 9’s complement of these numbers can be
obtained as:-
 9-6 = 3, 99-27 = 72, 999-234 = 765, 999-672 = 327, thus 3, 72, 234, 672 are the 9’s complement of
the numbers described above.
 The 10’s complement :
 The 10’s complement of the any decimal number can be obtained by adding 1 to the 9’s complement
of the same number.
 The steps to find 10’s complement.
 Find the 10’s complement of the number by subtracting every digit of the number from 9.
 The number thus obtained by subtraction will be added with 1.
 Thus, 10’s complement of the number is obtained.
 Therefore, 10’s complement is 9’s complement + 1.
 Consider some decimal numbers 7, 34, 566, 3456, now let’s find 9’s complement of each of these.
 9-7 = 2, 99-34 = 65, 999-566 = 433, 9999-3456 = 6543
 Thus, 2, 65, 433 & 6543 are the 9’s complement of the above considered numbers. Now, in order to
find 10’s complement of these numbers let’s add 1 to each of these numbers.
 2+1 = 3, 65+1 = 66, 433+1 = 434, 6543+1 = 6544
 Thus, 3, 66, 434 & 6544 are the 10’s complement of the numbers 7, 34, 566, and 3456 respectively.

Q-8 Explain conversion of binary to decimal.


 Get the last digit of the binary number; call this digit the current Digit.
 Make a variable, let's call it power. Set the value to 0.
 Multiply the current digit with (2^power), store the result.
 Increment power by 1.
 Set the the currentDigit to the previous digit of the binary number.
 Repeat step 3 until all digits have been multiplied.
 Sum the result of step 3 to get the answer number.

DLD (24DIEE202) Page 8


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

Q-9 Explain conversion of decimal to binary using double-double method.


 The most popular way to convert a decimal number into the binary is the double – double method.
 In this method, the given number is progressively divided by 2 and writing the remainder after
each division. When all the remainder is read in reverse order, the binary number is obtained.
 Steps for Decimal to Binary Conversion.
 Get the decimal number.
 Divide the decimal number by 2 and write quotient and remainder. This remainder is the LSB
(Least significant bit).
 Again divide the quotient obtained above by 2. This produces another quotient and remainder.
The remainder is the next digit of the binary number.
 Continue this process of division until the quotient becomes 0. The remainder obtained in the final
division is the MSB (most significant bit).
 Write the remainders in reverse order i.e. first remainder is LSB and last reminder is MSB.
 decimal For fractional numbers, multiply it by 2 and record the carry in the integral position.
The carries when read down produces the equivalent binary fraction.
 Example: convert (456.629)10 into binary.

DLD (24DIEE202) Page 9


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 So, the final result wil be(458.692)10 =(111001010.1011)2

Q - 10 Explain conversion of decimal to binary using sum of weights method.


 Steps for Decimal to Binary Conversion.
 Get the decimal number.
 Write the weights in exponential form or/and its value.
 Determine the set of binary weights whose sum is equal to decimal number.
 Place 1 and a 0 at appropriate positions i.e. place a 1 if weight is taken during the sum and 0
otherwise.
 Example: Convert decimal number 9 into its binary equivalent.
 8 4 2 1
 (9)10 = 8 + 0 + 0 + 1
 (9)10 = (1001)2

128 64 32 16 8 4 2 1
(13)10 0 0 0 0 1 1 0 1
(100)10 0 1 1 0 0 1 0 0
(65)10 0 1 0 0 0 0 0 1
(189)10 1 0 1 1 1 1 0 1

DLD (24DIEE202) Page 10


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

Q - 11 Explain conversion of octal to binary.

 Separate the digits of the given octal number, if it contains more than 1 digit.
 Find the equivalent binary number for each three digit of octal number. Add 0's to the left if any of
the binary equivalent is shorter than 3 bits.
 Write the all group's binary numbers together, maintaining the same group order provides the
equivalent binary for the given octal number.
 Example: convert the octal number 352.563 to its equivalent binary number
 = (352.563)8
 = (011 101 010 . 101 110 011)2
 = (011101010.101110011)2
 Thus the required binary number is (011101010.101110011)2

Q - 12 Explain conversion of binary to octal.

 Take binary number.


 Divide the binary digits into groups of three (starting from right) for integer part and start from
left for fraction part.
 Convert each group of three binary digits to one octal digit.
 Example: Convert binary number 0110 011.1011 into octal number.
 = (0110 011.1011)2
 = (0 110 011 . 101 1)2
 = (110 011 . 101 100)2
 = (6 3 . 5 4)8
 = (63.54)8

Q - 13 Explain conversion of octal to decimal.

 Separate the digits of the given octal number, if it contains more than 1 digit.
 Multiply each digit of octal number with its increasing power of 8 from right to left.
 Add all the individual results provides the equivalent decimal number.
 Example: Convert octal number 4057.068 into decimal number.

DLD (24DIEE202) Page 11


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 4057.068 = 4*83 + 0*82 + 5*81 + 7*80 + 0*8-1 + 6*8-2


 = 2048 + 0 + 40 + 7 + 0 + 0.0937
 = 2095.093710
Q - 14 Explain conversion of decimal to octal.

 To convert the given decimal integer number to octal, divide the given number by 8 till
quotien is 0.
 The last remainder is the MSD.
 The remainders read upwards give the equivalent octal integre number.
 To convert the given decimal fraction number to octal, multiply the given number by 8 till quotien
is 0 ot 1.
 The first integer from top is the MSD.
 The integer to the left of the octal point read downwards give the octal fraction.

 Example: convert 378.9310 to octal

Q - 15 Explain conversion of hexadecimal to binary.

 Separate the digits of the given hexademal number, if it contains more than 1 digit.
 Find the equivalent binary number for each four digit of hexadecomal number. Add 0's to the left if
any of the binary equivalent is shorter than 3 bits.

DLD (24DIEE202) Page 12


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 Write the all group's binary numbers together, maintaining the same group order provides the
equivalent binary for the given hexadecimal number.

 Example: convert 3A9E.B0D16 to binary.

Q - 16 Explain conversion of binary to hexadecimal.


 Take binary number
 Divide the binary digits into groups of four (starting from right) for integer part and start from left
for fraction part.
 Convert each group of four binary digits to one hexadecimal digit.

 Example: Convert binary number 1010101101001 into hexadecimal number.


 (1010101101001)2
 = (1 0101 0110 1001)2
 = (0001 0101 0110 1001)2
 = (1 5 6 9)16
 = (1569)16

Q - 17 Explain conversion of hexadecimal to decimal.


 Separate the digits of the given hexadecimal number, if it contains more than 1 digit.
 Multiply each digit of hexadecimal number with its increasing power of 16 from right to left.
 Add all the individual results provides the equivalent decimal number.
 Example-1 − Convert hexadecimal number ABCDEF into decimal number.
 = (ABCDEF)16
 = (10x165+11x164+12x163+13x162+14x161+15x160)10

DLD (24DIEE202) Page 13


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 = (10485760+720896+49152+3328+224+15)10
 = (11259375)10 which is answer.

 Example-2 − Convert hexadecimal number 1F.01B into decimal number.


 = (1F.01B)16
 = (1x161+15x160 +0x16-1+1x16-2+11x16-3)10
 = (31.0065918)10 which is answer.

Q - 18 Explain conversion of decimal to hexadecimal.


 To convert the given decimal integer number to hexadecimal, divide the given number by 16
till quotien is 0.
 The last remainder is the MSD.
 The remainders read upwards give the equivalent hexadecimal integre number.
 To convert the given decimal fraction number to decimal, multiply the given number by 16 till
quotien is 0 ot 1.
 The first integer from top is the MSD.
 The integer to the left of the octal point read downwards give the hexadecimal fraction.
 Example: convert 2598.67510 to hexadecimal.

DLD (24DIEE202) Page 14


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

Q - 19 Explain conversion of octal to hexadecimal.


 To onvert an octal number to hexadecimal, the simplest way is to first convert the given octal
number to binary and then the binary number to hexadecimal.

 Example: convert 756.6038 to hexa.

Q - 20 Explain conversion of hexadecimal to octal.


 To onvert an hexadecimal number to octal, the simplest way is to first convert the given hexa
number to binary and then the binary number to octal.
 Example: convert B9F.AE16 to octal.

Q - 21 Explain binary addition with example.

 The binary number system uses only two digits 0 and 1.


 There are four basic operations for binary addition, as mentioned here.
 0+0=0 0+1=1 1+0=1 1+1=10
 In fourth case, a binary addition is creating a sum of (1 + 1 = 10) i.e. 0 is written in the given
column and a carry of 1 over to the next column.
 Example – Add 11101 and 11011.
 This sum is carried out by following step.
 1 + 1 = 10 = 0 with a carry of 1.
 1+0+1 = 10 = 0 with a carry of 1
 1+1+0 = 10 = 10 = 0 with a carry of 1

DLD (24DIEE202) Page 15


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 1+1+1= 10+1 = 11= 1 with a carry of 1


 1 +1 +1 = 11
 Note carefully that 10 + 1 = 11, which is equivalent to two + one = three (the next binary number
after 10)
 Thus the required result is 111000.

Q - 22 Explain binary subtraction with example.

 The binary number system uses only two digits 0 and 1.


 There are four basic operations for binary subtraction, as mentioned here.
 0-0=0 0-1=1(10-1=1) 1-0=1 1-1=0
 Example – Subtract 1100 and 1010.
 This sum is carried out by following step.
 0–0=0
 For 0 – 1 = 1, taking borrow 1 and then 10 – 1 = 1
 For 1 – 0 , since 1 has already been given, it becomes 0 – 0 = 0
 1–1=0
 Therefore the result is 0010.

Q - 23 Explain binary multiplication with example.

 The binary number system uses only two digits 0 and 1.


 There are four basic operations for binary multiplication,
as mentioned here.
 Example – Multiply 0011010 and 100111000.

DLD (24DIEE202) Page 16


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

Q - 24 Explain binary divison with example.

 The binary number system uses only two digits 0 and 1.


 There are four basic operations for binary multiplication, as mentioned here.
 1÷1 = 1 1÷0 = 0 0÷1 = Meaningless 0÷0 = Meaningless
 Example: 01111100 ÷ 0010 101101 ÷ 101

Q - 25 Explain BCD(Binary coded decimal) or 8421 code.


 Binary codes for decimal digits require a minimum of four digits. In weighted binary code each bit
has a weight 8, 4, 2, 1 and each digit is represented by a group of four bits.
 The 8421 code is also known as BCD(binary coded decimal) code.
 The BCD is a numeric code in which each digit of a decimal number is represented by a separate
group of bits.
 Decimal-to-BCD Conversion
 separate the decimal number into its weighted digits and then write down the equivalent 4-bit
8421 BCD code representing each decimal digit.

DLD (24DIEE202) Page 17


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

 convert the following decimal (denary) numbers: 8510, 57210 and 857910 into their 8421 BCD
equivalents.
 8510 = 1000 0101 (BCD)
 57210 = 0101 0111 0010 (BCD)
 857910 = 1000 0101 0111 1001 (BCD)
 BCD-to-Decimal Conversion
 divide the binary number into groups of four digits, starting with the least significant digit and
then write the decimal digit represented by each 4-bit group.
 Add additional zero’s at the end if required to produce a complete 4-bit grouping.
 Convert the following binary numbers: 10012, 10102, 10001112 and 10100111000.1012 into their
decimal equivalents.

 10012 = 1001BCD = 910


 10102 = this will produce an error as it is decimal 1010 and not a valid BCD number
 10001112 = 0100 0111BCD = 4710
 10100111000.1012 = 0101 0011 0001.1010BCD = 538.62510

Q - 26 Explain excess-3 code.


 Excess – 3 code is method form of a BCD number. It is obtained by adding 3 in decimal or 0011 in
binary to each coded number.
 Example: Convert decimal number 15.46 into Excess-3 code.
 = 15.46+33.33 = 48.79
 =0100 1000.0111 1001

 Example: Convert Excess-3 code 1001001 into BCD and decimal number.
 So, grouping 4-bit for each group, i.e., 0100 1001 and subtract 0011 0011 from given number.
Therefore,
 = 0100 1001 - 0011 0011 =0001 0110
 So, binary coded decimal number is 0001 0110 and decimal number will be 16.

DLD (24DIEE202) Page 18


School of Diploma Studies
Faculty of Engineering & Technology (DLD) Unit – 1

Q - 27 Explain reflected code.


 Gray code – also known as Cyclic Code, Reflected Binary Code (RBC), Reflected Binary (RB) or
Grey code – is defined as an ordering of the binary number system such that each incremental
value can only differ by one bit.

 Step to Convert Binary to Gray Code


 Write MSB of binary number as MSB of gray code.
 Add this MSB to the next binary bit.
 Avoid carry and continue the process untill last binary bit.
 Convert binary number 01001 to gray code.

Step to Convert Binary to Gray Code


 Write MSB of gray code as MSB of binary number.
 Add this MSB to the next gray code.
 Avoid carry and continue the process untill last gray code.
 Convert gary code number 01101 binary code.

Q - 28 Give a difference between 1's complement and 2's complement.

1's complement 2's complement

1’s complement of a binary number is another 2’s complement of a binary number is 1 added to
binary number obtained by toggling all bits in it, the 1’s complement of the binary number.
i.e., transforming the 0 bit to 1 and the 1 bit to 0.

1′ s complement has two representations of 0 2′ s complement, there is only one representation


(zero) – 00000000, which is positive zero (+0) for zero – 00000000 (+0) because if we add 1 to
and 11111111, which is negative zero (-0) 11111111 (-1), we get 00000000 (+0) which is the
same as positive zero.

While adding numbers using 1′ s complement, 2′ s complement has only one value for zero, and
we first do binary addition, then add in an end- doesn’t require carry values.
around carry value.
1's complement of 7 (0111) is 8 (1000) 2's complement of 7 (0111) is 9 (1001)

DLD (24DIEE202) Page 19

You might also like