Chapter 1 Review of Number Systems

Similar documents
Number System. Introduction. Decimal Numbers

Numbering systems. Dr Abu Arqoub

MACHINE LEVEL REPRESENTATION OF DATA

BINARY SYSTEM. Binary system is used in digital systems because it is:

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Korea University of Technology and Education

Digital Systems and Binary Numbers

CS & IT Conversions. Magnitude 10,000 1,

MC1601 Computer Organization

Chapter 2: Number Systems

Digital Fundamentals

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

COMP Overview of Tutorial #2

Arithmetic Operations on Binary Numbers

D I G I T A L C I R C U I T S E E

Number Systems CHAPTER Positional Number Systems

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES. 1.1 Introduction

CHW 261: Logic Design

in this web service Cambridge University Press

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

Number representations

Module 2: Computer Arithmetic

Chapter 1. Digital Systems and Binary Numbers

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

World Inside a Computer is Binary

Semester Transition Point. EE 109 Unit 11 Binary Arithmetic. Binary Arithmetic ARITHMETIC

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

Computer Organization

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Lecture (02) Operations on numbering systems

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

Lecture 2: Number Systems

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Introduction to Computers and Programming. Numeric Values

Binary Systems and Codes

CHAPTER TWO. Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER

Chapter 10 Binary Arithmetics

Introduction to Computer Science-103. Midterm

Integers. N = sum (b i * 2 i ) where b i = 0 or 1. This is called unsigned binary representation. i = 31. i = 0

CMPE223/CMSE222 Digital Logic Design. Positional representation

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds.

Digital Systems and Binary Numbers

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

Review of Number Systems

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design

Number System (Different Ways To Say How Many) Fall 2016

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

TOPIC: NUMBER SYSTEMS

Final Labs and Tutors

Numbers and Representations

Number Systems. Both numbers are positive

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

COMPUTER ARITHMETIC (Part 1)

CO212 Lecture 10: Arithmetic & Logical Unit

CHAPTER 2 (b) : AND CODES

Chapter 2. Data Representation in Computer Systems

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq

Binary Addition & Subtraction. Unsigned and Sign & Magnitude numbers

DIGITAL SYSTEM DESIGN

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds.

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

Chapter 5 : Computer Arithmetic

Number Systems Base r

Chapter 1 Emad Felemban

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Chapter 4 Section 2 Operations on Decimals

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes

SE311: Design of Digital Systems

Digital Systems COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Chapter 3: part 3 Binary Subtraction

NUMBER SYSTEMS AND CODES

Digital Systems and Binary Numbers

CHAPTER 2 Number Systems

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Digital Fundamentals

Chapter 10 - Computer Arithmetic

Octal & Hexadecimal Number Systems. Digital Electronics

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

Lecture 1: Digital Systems and Number Systems

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

Internal Data Representation

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

The. Binary. Number System

Binary. Hexadecimal BINARY CODED DECIMAL


Transcription:

1.1 Introduction Chapter 1 Review of Number Systems Before the inception of digital computers, the only number system that was in common use is the decimal number system which has a total of 10 digits (0 to 9). Computers use binary system because it can be represented easily in hardware. For example a capacitor in RAM memory can be charged or not charged. A charged state represents a 1 and an uncharged (or not fully charged) state represents a 0. Likewise data stored on a hard disk at the molecular level can be magnetically aligned in one pattern or its opposite. Each pattern represents a 1 or 0. In this chapter, we will learn What is meant by weighted number system? Basic features of weighted number systems. Commonly used number systems, e.g. decimal, binary, octal and hexadecimal. Conversion between number systems Signed number representation 1.2 Weighted number systems A number D consists of n digits with each digit has a particular position. Figure 1.1 Every digit position is associated with a fixed weight. Example of weighted number systems:the decimal number system is a weighted system. Here we can see how the value of the decimal number 9375 is estimated. 9 10 3 +3 10 2 +7 10 1 +5 10 0 = 9375. In this particular example, the weight of position 0 is 1, the weight of position 2 is 10, the weight of position 3is 100, the weight of position 4 is 1000 and so on. Here 10 is called as base or radix of decimal number system.

Example: Show how the value of the following decimal number is estimated. D = 52.946 5 10 1 +2 10 0 +9 10 1 +4 10 2 +6 10 3 = 52.946 Notation: Let (D) r denotes a number D expressed in a number system of radix r. Example: (29)10 Represents a decimal value of 29. The radix here means ten. (100)16 is a Hexadecimal number since r = 16. (100)2 is a Binary number (radix =2, i.e. two). Important number systems The decimal system r = 10 (r means here radix). Ten possible digits {0,1,2,3,4,5,6,7,8,9}. The binary system r = 2. Two possible digits {0,1}. A binary digit is referred to as bit. The left most bit has the highest weight called as most significant bit (MSB). The right most bit has the lowest weight called as least significant bit (LSB). The Octal system r = 8. Eight possible digits {0,1,2,3,4,5,6,7}. The hexadecimal system r = 16. Sixteen possible digits {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}.

Table 1.1 Number System Radix Symbols Binary 2 0 1 Octal 8 0 1 2 3 4 5 6 7 Decimal 10 0 1 2 3 4 5 6 7 8 9 Hexadecimal 16 0 1 2 3 4 5 6 7 8 9 A B C D E F 1.3 Conversion between number systems Working in binary can become very cumbersome and prone to errors. It is important to learn how to convert from one system to another. Before discussing about conversion between number systems, we will split the number conversion into two methods. (i) Converting decimal number to other number systems (binary, octal, hexadecimal etc) (ii) Converting other number systems into decimal number system. Conversion of decimal number system to other number systems To convert a decimal number into other number systems we use to divide the decimal number by radix or base value of new number system continuously until the quotient value becomes less than the radix value of new number system. Let us take examples to clear the point. Decimal to binary conversion So lets now take the steps and apply it to the decimal number 16. 16/2 = 8 + a remainder of 0 0 8/2 = 4 + a remainder of 0 0 4/2= 2 + a remainder of 0 0 2/2= 1 + a remainder of 0 0 1/2= 0 + a remainder of 1 1 So decimal number 16 in binary form is 10000. Note to write the binary number from our work one must start from the bottom of the dividing work and continue upward. Let try a more interesting number than 16 how about 21.

21/2 = 10 + a remainder of 1 1 10/2 = 5 + a remainder of 0 0 5/2 = 2 + a remainder of 1 1 2/2 = 1 + a remainder of 0 0 1/2 = 0 + a remainder of 1 1 So our decimal number 21 written in binary is 10101. So let s try another number but one that is a little large. I think that 57 would be a good choice. So again let s repeat the step to convert decimal number 57 to a binary number. 57/2 = 28 + remainder 1 1 28/2 = 14 + remainder 0 0 14/2 = 7 + remainder 0 0 7/2 = 3 + remainder 1 1 3/2 = 1 + remainder 1 1 1/2 = 0 + remainder 1 1 So our decimal number 57 written in binary form is 111001. Let move the discussion to converting fractional decimal numbers to binary. So take the fractional decimal number and multiply it by two. If the new number is greater than 1 then record the fraction part and then write a one to the far right of the paper. If the new number is less than one then write a zero to the far right of the paper. One will continue until the final number is a whole number or the fraction part goes to zero. So let show how to do this with an example. Let convert the decimal number 0.25 to binary. 2 * 0.25 = 0.50 no whole number 0 2* 0.50 = 1.00 whole number 1 The decimal number 0.25 equals the binary number of 0.01. Let s try another example how about the decimal number 0.0625 2*0.0625 = 0.125 no whole number 0 2*0.125= 0.25 no whole number 0 2*0.25= 0.50 no whole number 0 2*0.50=1 whole number 1 The decimal number 0.0625 is equal to the binary number of 0.0001

We are now able to convert whole and fractional decimal numbers to binary. So what does one do with a decimal number of let s say 57.0625 being converted to binary? Well rewrite 57.0625 as 57 and.0625. Then apply the steps of the early examples to convert 57 to binary which gives 111001 then apply the steps to convert 0.0625 to binary which gives 0.0001, then combine the two to form the new number. So 57.0625 in binary is 111001.0001. Decimal to octal conversion Converting from decimal (base ten) to octal (base eight) numbers follow a similar pattern as in the conversions between decimal to binary. So let s start off with an example using the decimal number 32 and lets convert it to octal. So this time instead of dividing by two we divide by eight and then write down the remainder and continue on the same path as in decimal to binary. Decimal number 32 32/8 = 4 + remainder 0 0 4/8 = 0 + remainder 4 4 so decimal number 32 in octal is 40.(Notice again we write from bottom remainder to top) Let try another number how about 73. so the decimal number 73 in octal from is 111. 73/8= 9 + remainder 1 1 9/8= 1 + remainder 1 1 1/8 = 0 + remainder 1 1 Finally lets try to convert the decimal number 345 to an octal number. So the decimal number 345 is in octal form 531. 345/8= 43 + remainder 1 1 43/8 = 5 + remainder 3 3 5/8 = 0 + remainder 5 5 Now let s talk about convert fractional number from decimal to octal and again every is the same as in the binary conversion except instead of multiplying by 2 we are multiplying by 8. Lets use the decimal number 0.015625 So. so 0.015625 in decimal is 0.01 in octal. Lets do another example how about 0.140625 So 0.015625* 8 = 0.125 whole number is 0 0 0.125* 8 = 1.0 whole number is 1 1

so 0.18125 in decimal is 0.11 in octal. 0.140625 * 8= 1.125 whole number is 1 1 0.125 * 8 = 1.0 whole number is 1 1 Clearly now converting number like 345.18125 in decimal to octal is just done in a same fashion as in binary. Write 345.140625. Convert 345 to octal which is 531. Convert 0.140625to octal which is 0.11 Then 345.140625 to octal is just 531.11 Decimal to hexadecimal conversion Converting from decimal (base ten) to hexadecimal (base sixteen) numbers follow a similar pattern as in the conversions between decimal to octal. So let s start off with an example using the decimal number 32 and lets convert it to octal. So this time instead of dividing by eight we divide by sixteen and then write down the remainder and continue on the same path as in decimal to octal. Decimal number 31 31/16 = 1 + remainder 15 (In hexadecimal 15=F) F 1/16 = 0 + remainder 1 1 so decimal number 31 in hexadecimal is 1F.(Notice again we write from bottom remainder to top). Let try another number how about 173. so decimal number 173 in hexadecimal is AD. 173/16 = 10 + remainder 13 (In hexadecimal 13=D) D 10/16 = 0 + remainder 10 (In hexadecimal 10=A) A Conversion of other number systems to decimal number system Converting other number systems into decimal system is much easier. Just by knowing the radix value of the number system and position, we can easily compute the decimal value. Let us explain with examples. Binary to decimal conversion The binary number has a radix of 2. Like the decimal system, binary is a positional system, except that each bit position corresponds to a power of 2 instead of a power of 10. Example: The decimal equivalent of the binary number 101010. 1 2^5+0 2^4+1 2^3+0 2^2+1 2^1+0 2^0 = 43.

To convert the fractional binary number into its equivalent decimal number, the same principle as above is followed. But after the binary point (like decimal point in decimal number system) the bit position corresponds to a negative power of 2. Example: The decimal equivalent of the binary number 11001.11 Octal to decimal conversion 1 2^4+1 2^3+0 2^2+0 2^1+1 2^0+1 2^-1+1 2^-2 = 25.75. As in the decimal and binary systems, the positional valued of each digit in a sequence of numbers is fixed. Each position in an octal number is a power of 8. Example: The decimal equivalent of the octal number 15.2. 1 8^1+5 8^0+2 8^-1 = 13.25 Hexadecimal to decimal conversion As in the decimal and binary systems, the positional valued of each digit in a sequence of numbers is fixed. Each position in a hexadecimal number is a power of 16. Example: The decimal equivalent of the hexadecimal number B23. 11 16^2+2 16^1+3 16^0 = 2851. (In hexadecimal B is equal to 11) Octal to binary Conversion and vice versa Table1. 2 Binary Octal 000 0 001 1 010 2 011 3 100 4 101 5 110 6 111 7

This table shows the binary equivalent of octal numbers 0 to 7. Using this table we can convert any octal number to binary number or vice versa. Example: Let consider the octal number 7430. To write it in binary, just replace every octal number by its binary value. But remind that each octal digit should be replaced by 3 bits. For example octal 0 should be replaced by 000. 7430 = 111100011000 Let us take another example. Consider binary number 1100101. Group three bits from right to left. We have 101 at right most, then 100. After that we have one bit 1. We can add zeros in the MSB without affecting the value. So we can consider it as 001. The octal equivalent is 145. Hexadecimal to binary Conversion and vice versa Table 1.3 Binary Hexadecimal 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 1011 B 1100 C 1101 D 1110 E 1111 F

This table shows the binary equivalent of hexadecimal numbers 0 to 9, then A to F. Using this table we can convert any hexadecimal number to binary number or vice versa. Example: Let consider the octal number 743A. To write it in binary, just replace every digit by its binary value. But remind that each hexadecimal digit should be replaced by 4 bits. For example 1 should be replaced by 0001. 743A = 0111010000111010 Let us take another example. Consider binary number 1100101. Group four bits from right to left. We have 0101 at right most, then 110.We can add zeros in the MSB without affecting the value. So we can consider it as 0110. The hexadecimal equivalent is 65. 1.4 Signed number representation Negative numbers are essential, and any computer not capable of dealing with them would not be particularly useful. But how can such numbers be represented? There are several methods which can be used to represent negative numbers in Binary. Some of them are signed magnitude method, signed 1 s complement method and signed 2 s complement method. Signed magnitude representation Let us assume that we have an 8-bit register. This means that we have 7 bits which represent a number and the other bit to represent the sign of the number (the Sign Bit). This is how numbers are represented: The msb digit means that the number is positive. The rest of the digits represent 37. Thus, the above number in sign-magnitude representation, means +37. And this is how -37 is represented: There are problems with sign-magnitude representation of integers. One problem corresponds to "minus zero", 1000 0000. Another corresponds to "plus zero", 0000 0000. Signed 1 s complement representation The msb digit means that the number is positive. The rest of the digits represent 37. Thus, the above number in sign-1 s complement representation, means +37. And this is how -37 is represented:

To represent negative numbers, the magnitude should be written in one s complement. Signed 2 s complement representation It is one of many ways to represent negative integers with bit patterns. But it is now the nearly universal way of doing this. Integers are represented in a fixed number of bits. Both positive and negative integers can be represented. The msb digit means that the number is positive. The rest of the digits represent 37. Thus,the above number in sign-2 s complement representation means +37. And this is how -37 is represented: To represent negative numbers, the magnitude should be written in two s complement. Two s complement is obtained by taking one s complement and then add 1. Note that only negative number representation is different for different methods of representation. Positive numbers are represented in the same way in all the methods. 1.5 Binary arithmetic Because of its widespread use, we will concentrate on addition and subtraction for Two's Complement representation. The nice feature with Two's Complement is that addition and subtraction of Two's complement numbers works without having to separate the sign bits (the sign of the operands and results is effectively built-into the addition/subtraction calculation). Two's Complement Addition Add the values and discard any carry-out bit. Examples: using 8-bit two s complement numbers. Add 8 to +3 (+3) 0000 0011 +( 8) 1111 1000 ----------------------- ( 5) 1111 1011 ------------------------

Add 5 to 2 ( 2) 1111 1110 Overflow Rule for addition +( 5) 1111 1011 ------------------------ ( 7) 11111 1001 : discard carry-out ------------------------- If 2 Two's Complement numbers are added, and they both have the same sign (both positive or both negative), then overflow occurs if and only if the result has the opposite sign. Overflow never occurs when adding operands with different signs. i.e. Adding two positive numbers must give a positive result Adding two negative numbers must give a negative result Overflow occurs if (+A) + (+B) = C ( A) + ( B) = +C Example: Using 4-bit Two's Complement numbers Two's Complement Subtraction ( 7) 1001 +( 6) 1010 ----------------- Subtrahend: what is being subtracted ( 13) 10011 = 3 : Overflow (largest ve number is 8) Minuend: what it is being subtracted from Example: 612-485 = 127 485 is the subtrahend, 612 is the minuend, 127 is the result Normally accomplished by negating the subtrahend and adding it to the minuend. Any carry-out is discarded.

Example: Using 8-bit Two's Complement Numbers (+8) 0000 1000 0000 1000 (+5) 0000 0101 -> Negate(2 s complement) -> +1111 1011 ----- ------------------ (+3) 1 0000 0011 : discard carry-out Overflow Rule for Subtraction If 2 Two's Complement numbers are subtracted, and their signs are different, then overflow occurs if and only if the result has the same sign as the subtrahend. Overflow occurs if (+A) ( B) = C ( A) (+B) = +C Example: Using 4-bit Two's Complement numbers ( 8 x +7) Subtract 6 from +7 (+7) 0111 0111 ( 6) 1010 -> Negate -> +0110 ---------- ----------- 13 1101 = 8 + 5 = 3 : Overflow 1.6 Non weighted number systems Non weighted codes are codes that are not positionally weighted. That is, each position within the binary number is not assigned a fixed value. Gray code: The gray code belongs to a class of codes called minimum change codes, in which only one bit in the code changes when moving from one code to the next. The Gray code is nonweighted code, as the position of bit does not contain any weight. The gray code is a reflective digital code which has the special property that any two subsequent numbers codes differ by only one bit. This is also called a unit-distance code. In digital Gray code has got a special place.

Table 1.4 Decimal Number Binary Code Gray Code 0 0000 0000 1 0001 0001 2 0010 0011 3 0011 0010 4 0100 0110 5 0101 0111 6 0110 0101 7 0111 0100 8 1000 1100 9 1001 1101 10 1010 1111 11 1011 1110 12 1100 1010 13 1101 1011 14 1110 1001 15 1111 1000 Binary to Gray Conversion Gray Code MSB is binary code MSB. Gray Code MSB-1 is the XOR of binary code MSB and MSB-1. MSB-2 bit of gray code is XOR of MSB-1 and MSB-2 bit of binary code. MSB-N bit of gray code is XOR of MSB-N-1 and MSB-N bit of binary code. 1.7 Decimal codes Binary codes for decimal digits require a minimum of four bits. Numerous different codes can be obtained by arranging four bits in different possible combinations. The following table shows different binary codes for decimal digits.

Table 1.5 Decimal 8421(BCD) 2421 5211 Excess-3 0 0000 0000 0000 0011 1 0001 0001 0001 0100 2 0010 0010 0011 0101 3 0011 0011 0101 0110 4 0100 0100 0111 0111 5 0101 1011 1000 1000 6 0110 1100 1010 1001 7 0111 1101 1100 1010 8 1000 1110 1110 1011 9 1001 1111 1111 1100 The BCD (Binary Coded Decimal) is a straight assignment of the binary equivalent. It is possible to assign weights to the binary bits according to their positions. The weights in the BCD code are 8,4,2,1. Example: The bit assignment 1001 can be seen by its weight to represent the decimal 9 because 1 8+0 4+0 2+1 1 = 9. 2421 is a weighted code, its weights are 2, 4, 2 and 1. A decimal number is represented in 4-bit form and the total four bits weight is 2 + 4 + 2 + 1 = 9. Hence the 2421 code represents the decimal numbers from 0 to 9. 5211 is a weighted code, its weights are 5, 2, 1 and 1. A decimal number is represented in 4-bit form and the total four bits weight is 5 + 2 + 1 + 1 = 9. Hence the 5211 code represents the decimal numbers from 0 to 9. Excess-3 code is a non weighted code used to express decimal numbers. The code derives its name from the fact that each binary code is the corresponding 8421 code plus 3. Example: 1000 of 8421 code= 1011 in Excess-3 code A code is said to be reflective or self-complementing when code for 9 is complement for the code for 0, and so is for 8 and 1 codes, 7 and 2, 6 and 3, 5 and 4. Codes 2421, 5211, and excess-3 are reflective, whereas the 8421 code is not. A code is said to be sequential when two subsequent codes, seen as numbers in binary representation, differ by one. This greatly aids mathematical manipulation of data. The 8421 and Excess-3 codes are sequential, whereas the 2421 and 5211 codes are not.

1.8 Summary We have started our discussion with the need for studying different number systems. Then we learn to convert one base to another base (conversion of one number system to other number system). We have discussed about the different signed number representation. From many methods of signed number representation, signed 2 s complement representation is mostly used in the digital systems. So signed 2 s complement additions, signed 2 s complement subtraction are explored with examples. At the end of chapter we have discussed about some non-weighted codes like gray code, excess-3 code. We have defined self- complemented codes like excess-3, 5211, 2421 codes Review Questions: 1. List first 16 numbers in base 12. Use the letters A and B to represent last two digits. 2. Convert the following binary numbers to decimal: 101110: 1110101.11: and 110110100. 3. Convert the following numbers with the indicated bases to decimal: (12121) 3 ; (4310) 5 ; (50) 7 ; and (198) 12. 4. Convert the following decimal numbers to binary: 73.23; and 98. 5. Convert the following decimal numbers to the indicated bases: (a) 7562.45 to octal. (b) 1938.257 to hexadecimal. (c) 175.175 to binary. 6. Convert the hexadecimal number F3A7C2 to binary and octal. 7. Convert the following numbers from the given base to the other three bases indicated. (a) Decimal 225 to binary, octal, and hexadecimal. (b) Binary 11010111 to decimal, octal, and hexadecimal. (c) Octal 623 to decimal, binary, and hexadecimal. (d) Hexadecimal 2AC5 to decimal, octal, and binary. 8. Find the 1's and 2's complements of the following 8-digit binary numbers: 10101110;10000001; 10000000; 00000001; and 00000000. 9. Perform the subtraction with the following unsigned binary numbers by taking the 2'scomplement of the subtrahend. (a) 11010-10000 (b) 11010-1101 (c) 100-11000 (d) 1010100 1010100

10. Perform the arithmetic operations (+42) + (-13) and (-42) - (-13) in binary using the signed- 2's-complement representation for negative numbers. 11. The binary numbers listed have a sign in the leftmost position and, if negative, are in 2'scomplement form. Perform the arithmetic operations indicated and verify the answers. (a) 101011 + 111000 (b) 001110 + 110010 (c) 111001-001010 (d) 101011 100110 12. Represent the following decimal numbers in BCD: 13597; 93286; and 99880. 13. Determine the binary code for each of the ten decimal digits using a weighted code withweights 7, 4, 2, and 1. 14. Represent decimal number 8620 in (a) BCD, (b) excess-3 code, (c) 2421 code, and (d) as abinary number.