CHAPTER 2 NUMBER SYSTEMS

Size: px
Start display at page:

Download "CHAPTER 2 NUMBER SYSTEMS"

Transcription

1 CHAPTER 2 NUMBER SYSTEMS The Decimal Number System : We begin our study of the number systems with the familiar decimal number system. The decimal system contains ten unique symbol 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. Since counting in decimal involves ten symbols, we say that its base or radix is ten. There is no symbol for its base, i.e. for ten. It is a positional weighted system. It means that the value attached to a symbol depends on its location with respect to the decimal point. In this system, any number (integer, fraction or mixed) of any magnitude can be represented by the use of these ten symbols only. Each symbol in the number is called a digit. The left most digit in any number representation, which has the greatest positional weight out of all the digits present in the number, is called the most significant digit (MSD) and the right most digit which has the least positional weight out of all the digits present in that number, is called the least significant digit (LSD). The digits on the left side of the decimal point from the integer part of a decimal number and those on the right side from the fractional part. The digits to the right of the decimal point have weights which are negative powers of 10 and the digits to the left of the decimal point have weights which are positive powers of 10. The value of a decimal number is the sum of the products of the digits of that number with their respective column weights. The weight of each column is 10 times greater than the weight of the column to its right. The first digit to the left of the decimal point has a weight of unity or 10 0, the second digit to the left of the decimal point has a weight of 10 or 10 1, the third has a weight of 100 or 10 2, and so on. The first digit to the right of the decimal point has a weight of 1/1 or 10 1, the second digit to the right has a weight of 1/100 or 10-2, the third has a weight of 1/1000 or 10-3, and so on.

2 In general, the value of any mixed decimal number d n d n-1 d n-2... d 1 d 0. d -1 d -2 d d -k is given by (d n x 10 n ) + (d n 1 x 10 n 1 ) (d 1 x 10 1 ) + (d 0 x 10 0 ) + (d -1 x 10-1 ) + (d -2 x 10-2 ) +... Consider the decimal number using digit 2, 5, 6, 9. This is mixed number. Hence, = 9 x x x x x (1/10) + 6 x (1/100) = 9 x x x x x x 10-2 Consider another number , using the same digits 2, 5, 6, 9. Here, = 6 x x x x x x 10-2 Note the difference in position values of the same digits, when placed in different positions. Nine s and Ten s Complements The 9 s complement of a decimal number is obtained by subtracting each digit of that decimal number from 9. The 10 s complement of a decimal number is obtained by adding a 1 to its 9 s complement. To perform decimal subtraction using the 9 s complement method, obtain the 9 s complement of the subtrahend and add it to the minuend. Call this number the intermediate result. If there is a carry, it indicates that the answer is positive. Add the carry to the LSD of this result to get the answer. The carry is called the end around carry. If there is no carry, it indicates that the answer is negative and the intermediate result is its 9 s complement. Take the 9 s complement of this result and place a negative sign in front to get the answer. To perform decimal subtraction using the 10 s complement method, obtain the 10 s complement of the subtrahend and add it to the minuend. Call this number the intermediate result. If there is a carry, it indicates that the answer is positive and ignore that carry.the result obtained is itself a result. If there is no carry, it indicates that the answer is negative and the intermediate

3 result is its 10 s complement. Take the 10 s complement of this result and place a negative sign in front to get the answer. Example : Find the 9 s complement of the following decimal numbers. (a) 3465 (b) (c) (a) (9 s complement of 3465) (b) (9 s complement of ) (c) (9 s complement of ) Example : Find 10 s complement of the following decimal numbers. (a) 4069 (b) (a) (9 s complement of 4069) (10 s complement of 4069) (b) (9 s complement of 4069)

4 (10 s complement of 4069) Example : Subtract the following numbers using the 9 s complement method. (a) (b) (a) (b) The 9 s complement of is Therefore, the answer is (9 s complement of ) (Intermediate result) (End around carry) (Answer) (9 s complement of ) (Intermediate result with no carry) Example: Subtract the following numbers using the 10 s complement method (a) (b) : (a) (a) (10 s complement of ) (Ignore the carry)

5 The answer is The Binary Number System : The binary number system is a positional weighted system. the base or radix of this number system is 2. Hence, it has two independent symbols. The base itself cannot be a symbol. The symbols used are 0 and 1. A binary digit is called a bit. A binary number consists of a sequence of bits, each of which is either a 0 or a 1. The binary point separates the integer and fraction parts. Each digit (bit) carries a weight based on its position relevant to the binary point. The weight of each bit position is one power of 2 greater than the weight of the position to its immediate right. The first bit to the left of the binary point has weight of 2 0 and the column is called the units column. The second bit to the left has a weight 2 1 and it is in the 2 s column. The third bit to the left has a weight of 2 2 and it is in the 4 s column, and so on. The first bit to the right of the binary point has a weight of 2-2 is in the ¼ s column, and so on. The decimal value of the binary number is the sum of the products of all its bits multiplied by the weights of their respective positions. In general, a binary number with an integer part of (n + 1) bits and a fraction part of k bits can be written as d n d n-1 d n d 1 d 0. d -1 d -2 d d -k

6 Its decimal equivalent is (d n x 2 n ) + (d n-1 x 2 n-1 ) (d 1 x 2 1 ) + (d 0 x 2 0 ) + (d -1 x 2-1 ) + (d -2 x 2-2 )... In general, the decimal equivalent of the number d n d n-1... d 1 d 0.d -1 d in any number system with base b is given by (d n x b n ) + (d n-1 x b n-1 ) (d 1 x b 1 ) + (d 0 x b 0 ) + (d -1 x b -1 ) + (d -2 x b -2 ) +... The binary number system is used in digital computers because the switching circuits used in these computers use two-state devices such as transistors, diodes, etc. A transistor can be OFF or ON, a switch can be OPEN or CLOSED, a diode can be OFF or ON, etc. These devices have to exist in one of the two possible states. So, these two states can be represented by the symbols 0 and 1, respectively. Counting in Binary :- Counting in binary is very much similar to decimal counting as shown in Table. Start counting with 0, the next count is 1. We have now exhausted all symbols; therefore we put a 1 in the column to left and continue to get 10, 11. Thus, 11 is the maximum we can count using two bits. So, put a 1 in the next column to the left and continue counting; we can count 100, 101, 111. The largest number we can count using three bits is 111. Put a 1 to the left and continue; we get, 1000, 1001, 1010, 1011, 1100, 1101, 1110, The maximum count we can get using four bits is Continue counting with 5, 6,... bi ts as shown in Table. Table Counting in binary Decimal number Binary number Decimal number Binary number

7 An easy way to remember to write a binary sequence of n bits is : The right most column is the binary number begins with a 0 and alternates between 0 and 1 The second column begins with 2 (=2 1 ) zeros and alternates between the groups of 0 0 and 1 1 The third column begins with 4(= 2 2 ) zeros and alternates between the groups of and The n th column begins with 2 n-1 zeros and alternates between the groups of 2 n-1 zeros and 2 n-1 ones. Binary to Decimal Conversion Binary numbers may be converted to their decimal equivalents by the positional weights method. In this method, each binary digit of the number is multiplied by its position weight and the product terms and added to obtain the decimal number.

8 Example :Convert to decimal : (Positional weights) (Binary number) = (1 x 2 4 ) + (0 x 2 3 ) + (1 x 2 2 ) + (0 x 2 1 ) + (1 x 2 0 ) = = Example : Convert to decimal : = (1 x 2 4 ) + (1 x 2 3 ) + (0 x 2 2 ) + (1 x 2 1 ) + (1 x 2-1 ) + (1 x 2-2 ) + (1 x 2-3 ) = = Decimal to Binary Conversion : method : In this method, the decimal integer number is converted to binary integer number by successive division by 2, and the decimal fraction is converted to binary fraction by successive multiplication by 2. This is also known as double-dabble method. In the successive division by 2 method, the give decimal integer number is successively divided by 2 till the quotient is zero. The last remainder is the MSB. The remainders read from bottom to top give the equivalent binary integer number. In the successive multiplication by-2 method, the given decimal fraction and the subsequent decimal fractions are successively multiplied by 2, till the fraction part of the product is 0 or till the desired accuracy is obtained. The first

9 integer obtained is the MSB. Thus, the integers and read from top to bottom give the equivalent binary fraction. To convert a mixed number to binary, convert the integer and fraction parts separately to binary and then combine them. In general, these methods can be used for converting a decimal number to an equivalent number in any other base system by just replacing 2 by the base b of that number system. That is, any decimal number can be converted to an equivalent number in any other base system by the sum-of-weights method, or by the double-dabble method repeated division-by-b for integers and multiplication by b for fractions. Example : Convert to binary using the double-dabble method We divide the given decimal number successively by 2 and read the remainders upwards to get the equivalent binary number. Successive division Remainder Reading the remainder from bottom to top, the result is = Example : Convert to binary using the double-dabble method Multiply the given fraction by 2. Keep the integer in the product as it is and multiply the new fraction in the product by 2. Continue this process and read the integers in the products from top to bottom. Given Fraction 0.75 Multiply 0.75 by

10 Multiply 0.50 by Reading the integers from top to bottom = Example : Covert to binary. Conversion of integer 105. Successive division Remainder Reading the reminders from bottom to top, = Conversion of fraction Given Fraction 0.15 Multiply 0.15 by 2 Multiply 0.30 by 2 Multiply 0.60 by 2 Multiply 0.20 by 2 Multiply 0.40 by 2 Multiply 0.80 by This particular fraction can never be expressed exactly in binary. This process may be terminated after a few steps. Reading the integers from top to bottom, = Therefore, the final result is, = Binary Addition : The rules for binary addition are the following: = 0; = 1; = 1; = 10 i.e. 0 with a carry of 1

11 Example : Add the binary numbers 1010 and (Column number) In the 1 s column = 1 In the 2 s column = 0 with a carry of 1 to the 4 s column In the 4 s column = 0 with a carry of 1 to the 8 s column In the 8 s column = 0 with a carry of 1 to the 16 s column Example : Add the binary numbers and (Column number) In the 2 3, s column = 0, with a carry of 1 to the 2-2 column In the 2 2, s column = 0, with a carry of 1 to the 2-1 column In the 2 1, s column = 0, with a carry of 1 to the 1 s column In the 1 s column = 1, with a carry of 1 to the 2 s column In the 2 s column = 0, with a carry of 1 to the 4 s column In the 4 s column = 1, with a carry of 1 to the 8 s column In the 8 s column = 0, with a carry of 1 to the 16 s column Binary Subtraction :

12 The binary subtraction is performed in a manner similar to that in decimal subtraction. The rules for binary subtraction are : 0 0 = 0; 1 1 = 0; 1 0 = 1; 0 1 = 1, with a borrow of 1. Example :Subtract 10 2 from : In the 1 s column 0 0 = 0 In the 2 s column, a 1 cannot be subtracted from 0; so, a 1 must be borrowed from the 4 s column. But the 4 s column also has a 0; so, a 1 must be borrowed from the 8 s column, making the 8 s column 0. the 1 borrowed from the 8 s column becomes 10 in the 4 s column. Keep one 1 in the 4 s column and bring the remaining 1 to the 2 s column. This becomes 10 in the 2 s column, so 10 1 = 1 in the 2 s column. In the 4 s column 1 0 = (Column number) In the 8 s column 0 0 = Hence, the result is Example : Subtract from : (Column number) In the 2-3 column, a 1 cannot be subtracted from a 0. So, borrow a 1 from the 2 2 column making the 2-2 column 0. The 1 borrowed from the 2-2 column becomes 10 in the 2-3 column. Therefore, in the 2-3 column 10 1 = 1. In the 2-2 column, as 1 cannot be subtracted from a 0. So, borrow a 1 from the 2-1 column, but it is also a 0. So, borrow a 1 from the 1 s column. That is also a 0, so borrow a 1 from the 2 s column making the 2 s column 0. this 1 borrowed from the 2 s column becomes 10 in the 1 s column. Keep one 1 in the 1 s column, bring the other 1 to the 2-1 column, which becomes 10 in this

13 column, keep one in the 2-1 column and bring the other 1 to 2-2 column, which becomes 10 in this column. Therefore, In the 2-2 s, column 10 1 = 1 In the 2-1 s, column 1 1 = 0 In the 1 s, column 1 1 = 0 Now in the 2 s column, a 1 cannot be subtracted from a 0, so, borrow a 1 from the 4 s column. But the 4 s column has a 0. So, borrow a 1 from the 8 s column, making the 8 s column 0, and bring it to the 4 s column. It becomes 10 in the 4 s column. Keep one 1 in the 4 s column and bring the second 1 to the 2 s column making it 10 in the 2 s column. Therefore, In the 2 s column 10 1 = 1 In the 4 s column 1 1 = 0 In the 8 s column 0 0 = 0 Hence, the result is Binary Multiplication There are two method of binary multiplication the paper method and the computer method. Both the methods obey the following multiplication rules: 0 x 0 = 0; 1 x 1 = 1; 1 x 0 = 0; 0 x 1 = 0 The paper method is similar to the multiplication of decimal numbers on paper. Multiply the multiplicand with each bit of the multiplier, and add the partial products. The partial product is the same as the multiplicand if the multiplier bit is a 1 and is zero if the multiplier bit is a 0. Example: Multiply by The LSB of the multiplier is a 0. So, the first partial product is a 0. The next two bits of the multiplier are 1s. So, the next two partial products are equal to the multiplicand itself. The sum of the partial x

14 products gives the answer Example: Multiply by : x Binary Division Like multiplication, division too can be performed by two method the paper method and the computer method. In the paper method, long division procedures similar to those in decimal are used. Example: Divide by Divisor 110 cannot go in 101. So, consider the first 4 bits 1011 of the dividend. 110 can go in 1011, one time with a remainder of 101. Next, 110 can go in 1010, one time with a remainder of 100. Next 110 can go in 1001, one time with a remainder of 11. finally, 110 can go in 110 with a remainder of ) (

15 Therefore, = Example : Divide by : ) ( Therefore, = REPRESENTATION OF SIGNED NUMBERS AND BINARY ARITHMETIC IN COMPUTERS So far, we have considered only positive numbers. The representation of negative numbers is also equally important. There are two ways of representing signed numbers sign magnitude form and complement form. There are two complement forms: 1 s complement form and 2 s complement form. Most digital computers do subtraction by the 2 s complement method, but some do it by the 1 s complement method. The advantage of perfoming subtraction by the complement method is reduction in the hardware. Instead of having separate digital circuits are needed. That is, subtraction is also

16 performed by adders only. instead of subtracting one number from the other, the complement of the subtrahend is added to the minuend. In sign-magnitude form, an additional bit called the sign bit is placed in front of the number. If the sign bit is 0, the number is positive. If it is a 1, the number is negative for example, = + 41 Sign bit Magnitude = - 41 Sign bit Magnitude Under the signed magnitude system, a great deal of manipulation is necessary to add a positive number to a negative number. Thus, though the signed magnitude number system is possible, it is impractical. Representation of Signed Numbers using 2 s (or 1 s) Complement method The 2 s (or 1 s) complement system for representing signed numbers work like this: 1. If the number is positive, the magnitude is represented in its true binary from and a sign bit 0 is placed in from of the MSB 2. If the number is negative the magnitude is represented in its 2 s (or 1 s) complement form and a sign bit 1 is placed in front of the MSB. That is, to represent the numbers in sign 2 s (or 1 s) complement form, determine the 2 s (or 1 s) complement of the magnitude of the number and then attach the sign bit. The 2 s (or 1 s) complement operation on a signed number will change a positive number to a negative number and vice versa. The conversion of complement to true binary is the same as the process used to convert binary to complement. The representation of + 51 and 51 in both 2 s and 1 s complement forms is shown below: (In sign magnitude form) Sign bit Magnitude (In 2 s Complement form)

17 (In 1 s Complement form) (In sign magnitude form) Sign bit Magnitude Sign bit (In 2 s sign magnitude form) Magnitude (In 1 s sign magnitude form) Sign bit Magnitude Example : Express 45 in 8 bit 2 s complement form in 8 bit form is Obtain the 1 s complement of and then add 1. Positive expression of the given number s complement of it Add Thus, the 2 s complement form of 45 is Example : Express in 12 bit 2 s complement form = N = Positive expression of the given number s complement of it Add 1 1 Thus, the 2 s complement of is Two s Complement Arithmetic

18 The 2 s complement system is used to represent negative numbers using modulus arithmetic. The word length of a computer is fixed. That means, if a 4- bit number is added to another 4-bit number, the result will be only of 4 bits. Carry, if any, from the fourth bit will overflow. This is called the modulus arithmetic. For example : = In the 2 s complement subtraction, add the 2 s complement of the subtrahend to the minuend. If there is a carry out, ignore it. Look at the sign bit, i.e. MSB of the sum term. If the MSB is a 0, the result is positive and is in true binary form. If the MSB is a 1 (whether there is a carry or no carry at all) the result is negative and is in its 2 s complement form. Take its 2 s complement to find its magnitude in binary. Example : Subtract 14 from 46 using the 8-bit 2 s complement arithmetic = = (In 2 s complement from) (2 s complement form of 14) (Ignore the carry) There is a carry, ignore it. The MSB is 0; so, result is positive and is in normal binary form. Therefore, the result is = +32 Example : Add 75 to +26 using the 8 bit 2 s complement form = = (In 2 s complement from)

19 (2 s complement form of 75) (No carry) There is no carry, the MSB is a 1. So, the result is negative and is in 2 s complement form. The magnitude is 2 s complement of , that is, = 49. Therefore, the result is 49 Example : Add to using the 12-bit 2 s complement arithmetic. : ( in 2 s complement form) (Ignore the carry) There is a carry, ignore it. The MSB is 0; so, the result is positive and is in normal binary form. Therefore, the is Example : Add to using the 12-bit 2 s complement arithmetic ( in 2 s complement form) (No carry) The is no carry, indicating that the result is negative and is in its 2 s complement form. The 2 s complement of is Therefore, the result is 52.5 Example :Add to using the 2 s complement method ( in 2 s complement form) (-31.5 in 2 s complement form) (Ignore the carry)

20 There is a carry, ignore it. The MSB is a 1; so, the result is negative and is in its 2 s complement form. The 2 s complement of is Therefore, the result is Example : Add to using the 2 s complement method (No entry) There is no carry, and the MSB is 0. Therefore the result is positive and is in its true binary form. Hence, it is equal to Example : Add to using the 12 bit 2 s complement arithmetic ( in 2 s complement form) (No entry) There is a carry, ignore it. The result is 0 One s Complement Arithmetic The 1 s complement of a number is obtained by simply complementing each bit of the number, that is, by changing all the 0s to 1s and all the 1s to 0s. we can also say that the 1 s complement of a number is obtained by subtracting each bit of the number from 1. This complemented value represents the negative of the original number. This system is very easy to implement in hardware by simply feeding all bits thought inverters. One of the difficulties of using 1 s complement is its representation of zero. Both and its 1 s complement represent zero. The is called positive zero and the is called negative zero. Example : Represent 99 and in 8-bit 1 s complement form.

21 : We first write the positive representation of the given number in binary form and then complement each of its bits to represent the negative of the number. (a) = = (In 1 s complement form) (b) = = (In 1 s complement form) In 1 s complement subtraction, add the 1 s complement of the subtrahend to the minuend. If there is a carry out, bring the carry around and add it to the LSB. This is called the end around carry. Look at the sign bit (MSB); if this is a 0, the result is positive and is in true binary. If the MSB is a 1 (whether there is a carry or no carry at all), the result is negative and is in its 1 s complement form. Take its 1 s complement to get the magnitude in binary. Example: Subtract 14 from 25 using the 8-bit 1 s complement arithmetic (In 1 s complement form) (Add the end around carry) = Example : Add 25 to +14 using the 8-bit 1 s complement method (In 1 s complement form) (No carry) There is no carry and the MSB is a 1. So, the result is negative and is in its 1 s complement form. The 1 s complement of is The result is, therefore, Example : Add 25 to 14 using the 8-bit 1 s complement method.

22 (In 1 s complement form) There is no carry. The MSB is a 0. So, the result is positive and is in pure binary. Therefore, the result is, = + 39 Example :Add + 25 to 25 using the 8-bit 1 s complement method (In 1 s complement form) There is no carry. The MSB is a 1. So, the result is negative and is in its 1 s complement form. The 1 s complement of is therefore, the result is 0. Example: Subtract from using the 12 bit 1 s complement arithmetic (In 1 s complement form) (Add the end around carry) The MSB is a 0. So, the result is positive and is in its normal binary form. Therefore, the result is Example : Add to using the 12-bit 1 s complement method (In 1 s complement form)

23 There is no carry. The MSB is a 1. So, the result is negative and is in its 1 s complement form. The 1 s complement of is Therefore, the result is The Octal Number System The octal number system was extensively used by early minicomputers. It is also a positional weighted system. its base or radix is 8. It has 8 independent symbols 0, 1, 2, 3, 4, 5, 6, and 7. Since its base 8 = 2 3, every 3-bit group of binary can be respected by an octal digit. An octal number is, thus, 1/3 rd length of the corresponding binary number. Usefulness of the Octal System The ease with which conversions can be made between octal and binary makes the octal system more attractive as a shorthand means of expressing large binary numbers. In computer work, binary numbers with up to 64-bits are not uncommon. These binary numbers do not always represent a numerical quantity; they often represent some type of code, which conveys non-numerical information. In computers, binary numbers might represent (a) the actual numerical data, (b) the numbers corresponding to a location (address) in memory, (c) an instruction code, (d) a code expressing alphabetic and other non-numerical characters, or (e) a group of bits representing the status of devices internal or external to the computer. When dealing with large binary numbers of many bits, it is convenient and more efficient for us to write the numbers in octal rather than binary. However, the digital circuits and systems work strictly in binary; we use octal only for the convenience of the operators of the system. Table shows octal counting. Table Octal counting Decimal number Octal number Decimal number Octal number Decimal number Octal number Decimal number Octal number

24 Octal to Binary Conversion To convert a given octal number to a binary, just replace each octal digit by tis 3-bit binary equivalent. Example : Convert to binary. Given octal number is Convert each octal digit to binary Binary to Octal Conversion

25 To convert a binary number to an octal number, starting from the binary point make groups of 3 bits each, on either side of the binary point, and replace each 3-bit binary group by the equivalent octal digit. Example : Convert to octal. Group of three bits are Convert each group to octal The result is Example :Convert to octal. Group of three bits are = Convert each group into octal The result is Octal to Decimal Conversion To convert an octal number to a decimal number, multiply each digit in the octal number by the weight of its position and add all the product terms. The decimal value of the octal number d n d n-1 d n-2... d 1 d 0. d -1 d d -k is (d n x 8 n ) + (d n-1 x 8 n-1 ) (d 1 x 8 1 ) + (d 0 x 8 0 ) + (d -1 x 8-1 ) + (d -2 x 8-2 ) +... Example : Convert to decimal = 4 x x x x x x 8-2 = =

26 Decimal to Octal Conversion To convert a mixed decimal number to a mixed octal number, convert the integer and fraction parts separately. To convert the given decimal integer number to octal, successively divide the given number by 8 till the quotient is 0. The last remainder is the MSD. The remainders read upwards given the equivalent octal integer number. To convert the given decimal fraction to octal, successively multiply the decimal fraction by 8 till the product is 0 or till the required accuracy is obtained. The first integer from the top is the MSD. The integers to the left of the octal point read downwards give the octal fraction. Example : Convert octal : Conversion of octal Successive division Remainders Read the remainders from bottom to top. Therefore, = Conversion of to octal 0.93 x x x x Read the integers to the left of the octal point downwards. Therefore, = Hence = Conversion of large decimal numbers to binary and large binary numbers to decimal can be conveniently and quickly performed via octal as shown below.

27 Example : Convert to binary. Since the given decimal number is large, we first convert this number to octal and then convert the octal number to binary. Successive division Remainders Therefore, = = Example : Convert to decimal. Since the given binary number is large, we first convert this number to octal and then convert he octal number to decimal = = 5 x x x x 8 0 = = The Hexadecimal number system Binary numbers are long. These numbers are fine for machines but are too lengthy to be handled by human beings. So, there is a need to represent the binary numbers concisely. One number system developed with this objective is the hexadecimal number system (or Hex). Although it is somewhat more difficult to interpret than the octal number system, it has become the most popular of direct data entry and retrieval in digital systems. The

28 hexadecimal number system is a positional weighted system. The base or radix of this number system is 16, that means, it has 16 independent symbols. The symbols used are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. Since its base is 16 = 2 4, every 4 binary digit combination can be represented by one hexadecimal digit. So, a hexadecimal number, yet it provides the same information as the binary number. A 4-bit group is called a nibble. Since computer words come in 8 bits, 16 bits, 32 bits and so on, that is, multiples of 4 bits, they can be easily represented in hexadecimal. The hexadecimal system is particularly useful for human communications will computers. By far, this is the most commonly used number system in computer literature. It is used both in large and small computers. Hexadecimal counting sequence : A B C D E F A 1B 1C 1D 1E 1F F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF F0 1F1 1F2 1F3 1F4 1F5 1F6 1F7 1F8 1F9 1FA 1FB 1FC 1FD 1FE 1FF Binary to Hexadecimal conversion To convert a binary number to a hexadecimal number, starting from the binary point, make groups of 4 bits each, on either side of the binary point and replace each 4-bit group by the equivalent hexadecimal digit as shown in Table. Table 2.3 Binary to hexadecimal conversion Hexadecimal Binary Hexadecimal Binary

29 A B C D E F Example 54 Convert to hexadecimal. Make groups of 4 bits, and replace each 4-bit group by a hex digit. Given binary number is Groups of four bits are Convert each group to hex 2 D B The result 2DB 16 Example: Convert to hexadecimal. Given binary number is Groups of four bits are Convert each group to hex 2 F B. 7 C The result is 2FB.7C 16 Hexadecimal to Binary To convert a hexadecimal number to binary, replace each hex digit by its 4-bit binary group. Example : Convert 4BAC 16 to binary. Given hex number is 4 B A C Convert each hex digit to 4-bit binary There result is Example : Convert 3A9E.B0D 16 to binary.

30 Given hex number is 3 A 9 E B 0 D Convert each hex digit to 4-bit binary The result is Hexadecimal to Decimal To convert a hexadecimal number to decimal, multiply each digit in the hex number by its position weight and add all those product terms. If the hex number is d n d n-1... d 1 d 0. d -1 d d -k, its decimal equivalent is (d n x 16 n ) + (d n-1 x 16 n-1 ) (D 1 x 16 1 ) + (d 0 x 16 0 ) + (d -1 x 16-1 ) + (d -2 x 16-2 ) +... Example : Convert 5C7 by to decimal. Multiply each digit of 5C7 by its position weight and add the product terms. 5C716 = (5 X 16 2 ) + (12 X 16 1 ) + (7 X 16 0 ) = = Example : Convert A0F9.0EB 16 to decimal A0F9.0EB 16 = (10 x 16 3 ) + (0 x 16 2 ) + (15 x 16 1 ) + (9 x 16 0 ) + (0 x 16-1 ) + (14 x 16-2 ) + (11 x 16-3 ) = = Decimal to Hexadecimal To convert a decimal integer number to hexadecimal, successively divide the given decimal number by 16 till the quotient is zero. The last remainder is the MSB. The remainders read from bottom to top give the equivalent hexadecimal integer.

31 To convert a decimal fraction to hexadecimal, successively multiply the given decimal fraction by 16, till the product is zero or till the required accuracy is obtain, and collect all the integers to the left of decimal point. The first integer is the MSB and the integers read from top to bottom give the hexadecimal fraction. This is known as the hex dabble method. Example : Convert to hex The given decimal number is a mixed number. Convert the integer and the fraction parts separately to hex. Conversion of Successive division Remainder Decimal Hex A Reading the remainders upwards, = A26 16 Conversion of Given fraction is x x x x Reading the integers to the left of hexadecimal point downwards, = 0.ACCC 16 Therefore, = A26.ACCC 16 Conversion of very large decimal numbers to binary and very large binary numbers to decimal is very much simplified if it is done via the hex route.

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri MATH 1101 haalshehri@ksu.edu.sa 1 Introduction To Number Systems First Section: Binary System Second Section: Octal Number System Third Section: Hexadecimal System 2 Binary System 3 Binary System The binary

More information

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System? :33:3 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 3 Lecture #: Binary Number System Complement Number Representation X Y Why Binary Number System? Because

More information

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations. EE 260: Introduction to Digital Design Number Systems Yao Zheng Department of Electrical Engineering University of Hawaiʻi at Mānoa Overview n Digital Computers n Number Systems n Representations n Conversions

More information

of Digital Electronics

of Digital Electronics 26 Digital Electronics 729 Digital Electronics 26.1 Analog and Digital Signals 26.3 Binary Number System 26.5 Decimal to Binary Conversion 26.7 Octal Number System 26.9 Binary-Coded Decimal Code (BCD Code)

More information

Chapter 1 CSCI

Chapter 1 CSCI Chapter 1 CSCI-1510-003 What is a Number? An expression of a numerical quantity A mathematical quantity Many types: Natural Numbers Real Numbers Rational Numbers Irrational Numbers Complex Numbers Etc.

More information

Week No. 06: Numbering Systems

Week No. 06: Numbering Systems Week No. 06: Numbering Systems Numbering System: A numbering system defined as A set of values used to represent quantity. OR A number system is a term used for a set of different symbols or digits, which

More information

ENGIN 112 Intro to Electrical and Computer Engineering

ENGIN 112 Intro to Electrical and Computer Engineering ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems Overview Hexadecimal numbers Related to binary and octal numbers Conversion between hexadecimal, octal and binary Value

More information

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Numbering Systems Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Addition & Subtraction using Octal & Hexadecimal 2 s Complement, Subtraction Using 2 s Complement.

More information

ECE380 Digital Logic. Positional representation

ECE380 Digital Logic. Positional representation ECE380 Digital Logic Number Representation and Arithmetic Circuits: Number Representation and Unsigned Addition Dr. D. J. Jackson Lecture 16-1 Positional representation First consider integers Begin with

More information

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems Menu Review of number systems >Binary math >Signed number systems Look into my... 1 Our decimal (base 10 or radix 10) number system is positional. Ex: 9437 10 = 9x10 3 + 4x10 2 + 3x10 1 + 7x10 0 We have

More information

Conversions between Decimal and Binary

Conversions between Decimal and Binary Conversions between Decimal and Binary Binary to Decimal Technique - use the definition of a number in a positional number system with base 2 - evaluate the definition formula ( the formula ) using decimal

More information

14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation

14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation 4:332:23 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 203 Lecture #3: Addition, Subtraction, Multiplication, and Division 2 s-complement Representation RECALL

More information

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Hakim Weatherspoon CS 3410 Computer Science Cornell University Hakim Weatherspoon CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer. memory inst 32 register

More information

We say that the base of the decimal number system is ten, represented by the symbol

We say that the base of the decimal number system is ten, represented by the symbol Introduction to counting and positional notation. In the decimal number system, a typical number, N, looks like... d 3 d 2 d 1 d 0.d -1 d -2 d -3... [N1] where the ellipsis at each end indicates that there

More information

Four Important Number Systems

Four Important Number Systems Four Important Number Systems System Why? Remarks Decimal Base 10: (10 fingers) Most used system Binary Base 2: On/Off systems 3-4 times more digits than decimal Octal Base 8: Shorthand notation for working

More information

FYSE410 DIGITAL ELECTRONICS [1] [2] [3] [4] [5] A number system consists of an ordered set of symbols (digits).

FYSE410 DIGITAL ELECTRONICS [1] [2] [3] [4] [5] A number system consists of an ordered set of symbols (digits). FYSE4 DIGITAL ELECTRONICS Litterature: LECTURE [] [] [4] [5] DIGITAL LOGIC CIRCUIT ANALYSIS & DESIGN Victor P. Nelson, H. Troy Nagle J. David Irwin, ill D. Carroll ISN --4694- DIGITAL DESIGN M. Morris

More information

Digital Systems Roberto Muscedere Images 2013 Pearson Education Inc. 1

Digital Systems Roberto Muscedere Images 2013 Pearson Education Inc. 1 Digital Systems Digital systems have such a prominent role in everyday life The digital age The technology around us is ubiquitous, that is we don t even notice it anymore Digital systems are used in:

More information

Combinational Logic Design Arithmetic Functions and Circuits

Combinational Logic Design Arithmetic Functions and Circuits Combinational Logic Design Arithmetic Functions and Circuits Overview Binary Addition Half Adder Full Adder Ripple Carry Adder Carry Look-ahead Adder Binary Subtraction Binary Subtractor Binary Adder-Subtractor

More information

Binary addition example worked out

Binary addition example worked out Binary addition example worked out Some terms are given here Exercise: what are these numbers equivalent to in decimal? The initial carry in is implicitly 0 1 1 1 0 (Carries) 1 0 1 1 (Augend) + 1 1 1 0

More information

hexadecimal-to-decimal conversion

hexadecimal-to-decimal conversion OTHER NUMBER SYSTEMS: octal (digits 0 to 7) group three binary numbers together and represent as base 8 3564 10 = 110 111 101 100 2 = (6X8 3 ) + (7X8 2 ) + (5X8 1 ) + (4X8 0 ) = 6754 8 hexadecimal (digits

More information

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits Logic and Computer Design Fundamentals Chapter 5 Arithmetic Functions and Circuits Arithmetic functions Operate on binary vectors Use the same subfunction in each bit position Can design functional block

More information

Counting in Different Number Systems

Counting in Different Number Systems Counting in Different Number Systems Base 1 (Decimal) is important because that is the base that we first learn in our culture. Base 2 (Binary) is important because that is the base used for computer codes

More information

CSE 241 Digital Systems Spring 2013

CSE 241 Digital Systems Spring 2013 CSE 241 Digital Systems Spring 2013 Instructor: Prof. Kui Ren Department of Computer Science and Engineering Lecture slides modified from many online resources and used solely for the educational purpose.

More information

convert a two s complement number back into a recognizable magnitude.

convert a two s complement number back into a recognizable magnitude. 1 INTRODUCTION The previous lesson introduced binary and hexadecimal numbers. In this lesson we look at simple arithmetic operations using these number systems. In particular, we examine the problem of

More information

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4 Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4 4.1.1 Signal... 4 4.1.2 Comparison of Analog and Digital Signal... 7 4.2 Number Systems... 7 4.2.1 Decimal Number System... 7 4.2.2 Binary

More information

ECE260: Fundamentals of Computer Engineering

ECE260: Fundamentals of Computer Engineering Data Representation & 2 s Complement James Moscola Dept. of Engineering & Computer Science York College of Pennsylvania Based on Computer Organization and Design, 5th Edition by Patterson & Hennessy Data

More information

Numbers and Arithmetic

Numbers and Arithmetic Numbers and Arithmetic See: P&H Chapter 2.4 2.6, 3.2, C.5 C.6 Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University Big Picture: Building a Processor memory inst register file alu

More information

COMBINATIONAL LOGIC FUNCTIONS

COMBINATIONAL LOGIC FUNCTIONS COMBINATIONAL LOGIC FUNCTIONS Digital logic circuits can be classified as either combinational or sequential circuits. A combinational circuit is one where the output at any time depends only on the present

More information

ENGIN 112 Intro to Electrical and Computer Engineering

ENGIN 112 Intro to Electrical and Computer Engineering ENGIN 112 Intro to Electrical and Computer Engineering Lecture 2 Number Systems Russell Tessier KEB 309 G tessier@ecs.umass.edu Overview The design of computers It all starts with numbers Building circuits

More information

Why digital? Overview. Number Systems. Binary to Decimal conversion

Why digital? Overview. Number Systems. Binary to Decimal conversion Why digital? Overview It has the following advantages over analog. It can be processed and transmitted efficiently and reliably. It can be stored and retrieved with greater accuracy. Noise level does not

More information

CPE100: Digital Logic Design I

CPE100: Digital Logic Design I Chapter 1 Professor Brendan Morris, SEB 3216, brendan.morris@unlv.edu http://www.ee.unlv.edu/~b1morris/cpe100/ CPE100: Digital Logic Design I Section 1004: Dr. Morris From Zero to One Chapter 1 Background:

More information

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors Introduction to Digital Logic Missouri S&T University CPE 2210 Egemen K. Çetinkaya Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science and Technology cetinkayae@mst.edu

More information

ENG2410 Digital Design Introduction to Digital Systems. Fall 2017 S. Areibi School of Engineering University of Guelph

ENG2410 Digital Design Introduction to Digital Systems. Fall 2017 S. Areibi School of Engineering University of Guelph ENG2410 Digital Design Introduction to Digital Systems Fall 2017 S. Areibi School of Engineering University of Guelph Resources Chapter #1, Mano Sections 1.1 Digital Computers 1.2 Number Systems 1.3 Arithmetic

More information

Numbers and Arithmetic

Numbers and Arithmetic Numbers and Arithmetic See: P&H Chapter 2.4 2.6, 3.2, C.5 C.6 Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University Big Picture: Building a Processor memory inst register file alu

More information

THE LOGIC OF COMPOUND STATEMENTS

THE LOGIC OF COMPOUND STATEMENTS CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS Copyright Cengage Learning. All rights reserved. SECTION 2.4 Application: Digital Logic Circuits Copyright Cengage Learning. All rights reserved. Application:

More information

Fundamentals of Digital Design

Fundamentals of Digital Design Fundamentals of Digital Design Digital Radiation Measurement and Spectroscopy NE/RHP 537 1 Binary Number System The binary numeral system, or base-2 number system, is a numeral system that represents numeric

More information

Chapter 1. Binary Systems 1-1. Outline. ! Introductions. ! Number Base Conversions. ! Binary Arithmetic. ! Binary Codes. ! Binary Elements 1-2

Chapter 1. Binary Systems 1-1. Outline. ! Introductions. ! Number Base Conversions. ! Binary Arithmetic. ! Binary Codes. ! Binary Elements 1-2 Chapter 1 Binary Systems 1-1 Outline! Introductions! Number Base Conversions! Binary Arithmetic! Binary Codes! Binary Elements 1-2 3C Integration 傳輸與介面 IA Connecting 聲音與影像 Consumer Screen Phone Set Top

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture 6 - Combinational Logic Introduction A combinational circuit consists of input variables, logic gates, and output variables. The logic gates accept

More information

Hardware Design I Chap. 4 Representative combinational logic

Hardware Design I Chap. 4 Representative combinational logic Hardware Design I Chap. 4 Representative combinational logic E-mail: shimada@is.naist.jp Already optimized circuits There are many optimized circuits which are well used You can reduce your design workload

More information

12/31/2010. Digital Operations and Computations Course Notes. 01-Number Systems Text: Unit 1. Overview. What is a Digital System?

12/31/2010. Digital Operations and Computations Course Notes. 01-Number Systems Text: Unit 1. Overview. What is a Digital System? Digital Operations and Computations Course Notes 0-Number Systems Text: Unit Winter 20 Professor H. Louie Department of Electrical & Computer Engineering Seattle University ECEGR/ISSC 20 Digital Operations

More information

Computer Number Systems

Computer Number Systems Computer Number Systems All computers are electronic devices and can ultimately do one thing: detect whether an electrical signal is on or off. Therefore, the earliest computer scientists realized that

More information

Digital Systems and Information Part II

Digital Systems and Information Part II Digital Systems and Information Part II Overview Arithmetic Operations General Remarks Unsigned and Signed Binary Operations Number representation using Decimal Codes BCD code and Seven-Segment Code Text

More information

Number System conversions

Number System conversions Number System conversions Number Systems The system used to count discrete units is called number system. There are four systems of arithmetic which are often used in digital electronics. Decimal Number

More information

CHAPTER 7. Exercises 17/ / /2 2 0

CHAPTER 7. Exercises 17/ / /2 2 0 CHAPTER 7 Exercises E7. (a) For the whole part, we have: Quotient Remainders 23/2 /2 5 5/2 2 2/2 0 /2 0 Reading the remainders in reverse order, we obtain: 23 0 = 0 2 For the fractional part we have 2

More information

Digital Systems Overview. Unit 1 Numbering Systems. Why Digital Systems? Levels of Design Abstraction. Dissecting Decimal Numbers

Digital Systems Overview. Unit 1 Numbering Systems. Why Digital Systems? Levels of Design Abstraction. Dissecting Decimal Numbers Unit Numbering Systems Fundamentals of Logic Design EE2369 Prof. Eric MacDonald Fall Semester 2003 Digital Systems Overview Digital Systems are Home PC XBOX or Playstation2 Cell phone Network router Data

More information

CSEN102 Introduction to Computer Science

CSEN102 Introduction to Computer Science CSEN102 Introduction to Computer Science Lecture 7: Representing Information I Prof. Dr. Slim Abdennadher Dr. Mohammed Salem, slim.abdennadher@guc.edu.eg, mohammed.salem@guc.edu.eg German University Cairo,

More information

CSCI 255. S i g n e d N u m s / S h i f t i n g / A r i t h m e t i c O p s.

CSCI 255. S i g n e d N u m s / S h i f t i n g / A r i t h m e t i c O p s. Ying.Yang 1.-1 CSCI 255 http://cs.furman.edu In mathematics, negative integers exists -> forced to do it binary In a binary string, the MSB is sacrificed as the signed bit 0 => Positive Value 1 => Negative

More information

UNIT II COMBINATIONAL CIRCUITS:

UNIT II COMBINATIONAL CIRCUITS: UNIT II COMBINATIONAL CIRCUITS: INTRODUCTION: The digital system consists of two types of circuits, namely (i) (ii) Combinational circuits Sequential circuits Combinational circuit consists of logic gates

More information

Chapter 9 - Number Systems

Chapter 9 - Number Systems Chapter 9 - Number Systems Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 9 - Number Systems 1 / 50 1 Motivation 2 Positional Number Systems 3 Binary System L. Tarrataca Chapter

More information

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1 E40M Binary Numbers M. Horowitz, J. Plummer, R. Howe 1 Reading Chapter 5 in the reader A&L 5.6 M. Horowitz, J. Plummer, R. Howe 2 Useless Box Lab Project #2 Adding a computer to the Useless Box alows us

More information

Residue Number Systems Ivor Page 1

Residue Number Systems Ivor Page 1 Residue Number Systems 1 Residue Number Systems Ivor Page 1 7.1 Arithmetic in a modulus system The great speed of arithmetic in Residue Number Systems (RNS) comes from a simple theorem from number theory:

More information

Number Theory: Representations of Integers

Number Theory: Representations of Integers Instructions: In-class exercises are meant to introduce you to a new topic and provide some practice with the new topic. Work in a team of up to 4 people to complete this exercise. You can work simultaneously

More information

ALU (3) - Division Algorithms

ALU (3) - Division Algorithms HUMBOLDT-UNIVERSITÄT ZU BERLIN INSTITUT FÜR INFORMATIK Lecture 12 ALU (3) - Division Algorithms Sommersemester 2002 Leitung: Prof. Dr. Miroslaw Malek www.informatik.hu-berlin.de/rok/ca CA - XII - ALU(3)

More information

Radiological Control Technician Training Fundamental Academic Training Study Guide Phase I

Radiological Control Technician Training Fundamental Academic Training Study Guide Phase I Module 1.01 Basic Mathematics and Algebra Part 4 of 9 Radiological Control Technician Training Fundamental Academic Training Phase I Coordinated and Conducted for the Office of Health, Safety and Security

More information

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic CSE 20 Discrete Math Algebraic Rules for Propositional Formulas Equivalences between propositional formulas (similar to algebraic equivalences): Associative Summer, 2006 July 11 (Day 2) Number Systems/Computer

More information

B.Sc. PHYSICS III YEAR

B.Sc. PHYSICS III YEAR B.Sc. PHYSICS III YEAR DJK3C : DIGITAL ELECTRONICS SYLLABUS Unit I : Number System Decimal binary octal hexadecimal number system conversion from one system to another binary arithmetic 1 s complement

More information

0,..., r 1 = digits in radix r number system, that is 0 d i r 1 where m i n 1

0,..., r 1 = digits in radix r number system, that is 0 d i r 1 where m i n 1 RADIX r NUMBER SYSTEM Let (N) r be a radix r number in a positional weighting number system, then (N) r = d n 1 r n 1 + + d 0 r 0 d 1 r 1 + + d m r m where: r = radix d i = digit at position i, m i n 1

More information

Fundamentals of Mathematics I

Fundamentals of Mathematics I Fundamentals of Mathematics I Kent State Department of Mathematical Sciences Fall 2008 Available at: http://www.math.kent.edu/ebooks/10031/book.pdf August 4, 2008 Contents 1 Arithmetic 2 1.1 Real Numbers......................................................

More information

Physics 310 Lecture 10 Microprocessors

Physics 310 Lecture 10 Microprocessors Mon. 3/29 Wed. 3/31 Thurs. 4/1 Fri. 4/2 Mon. 4/5 Wed. 4/7 Thurs. 4/8 Fri. 4/9 Mon. 4/12 Wed. 4/14 Thurs. 4/15 Fri. 4/16 Project: Component Shopping Ch 13: Microprocessor Basics Intro to More Ch 13 Review

More information

Combinational Logic. By : Ali Mustafa

Combinational Logic. By : Ali Mustafa Combinational Logic By : Ali Mustafa Contents Adder Subtractor Multiplier Comparator Decoder Encoder Multiplexer How to Analyze any combinational circuit like this? Analysis Procedure To obtain the output

More information

Class Website:

Class Website: ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #5 Instructor: Andrew B. Kahng (lecture) Email: abk@ece.ucsd.edu Telephone: 858-822-4884 office, 858-353-0550 cell Office:

More information

CISC 1400 Discrete Structures

CISC 1400 Discrete Structures CISC 1400 Discrete Structures Chapter 2 Sequences What is Sequence? A sequence is an ordered list of objects or elements. For example, 1, 2, 3, 4, 5, 6, 7, 8 Each object/element is called a term. 1 st

More information

Save from: cs. Logic design 1 st Class أستاذ المادة: د. عماد

Save from:   cs. Logic design 1 st Class أستاذ المادة: د. عماد Save from: www.uotiq.org/dep cs Logic design 1 st Class أستاذ المادة: د. عماد استاذة المادة: م.م ميساء Contents Lectured One: Number system operation 1- Decimal numbers. 2- Binary numbers. 3- Octal numbers.

More information

Lecture 2 Review on Digital Logic (Part 1)

Lecture 2 Review on Digital Logic (Part 1) Lecture 2 Review on Digital Logic (Part 1) Xuan Silvia Zhang Washington University in St. Louis http://classes.engineering.wustl.edu/ese461/ Grading Engagement 5% Review Quiz 10% Homework 10% Labs 40%

More information

Binary Multipliers. Reading: Study Chapter 3. The key trick of multiplication is memorizing a digit-to-digit table Everything else was just adding

Binary Multipliers. Reading: Study Chapter 3. The key trick of multiplication is memorizing a digit-to-digit table Everything else was just adding Binary Multipliers The key trick of multiplication is memorizing a digit-to-digit table Everything else was just adding 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 2 2 4 6 8 2 4 6 8 3 3 6 9 2 5 8 2 24 27 4 4 8 2 6

More information

Number Bases. Ioan Despi. University of New England. August 4, 2013

Number Bases. Ioan Despi. University of New England. August 4, 2013 Number Bases Ioan Despi despi@turing.une.edu.au University of New England August 4, 2013 Outline Ioan Despi AMTH140 2 of 21 1 Frequently Used Number Systems 2 Conversion to Numbers of Different Bases 3

More information

Logic. Combinational. inputs. outputs. the result. system can

Logic. Combinational. inputs. outputs. the result. system can Digital Electronics Combinational Logic Functions Digital logic circuits can be classified as either combinational or sequential circuits. A combinational circuit is one where the output at any time depends

More information

A number that can be written as, where p and q are integers and q Number.

A number that can be written as, where p and q are integers and q Number. RATIONAL NUMBERS 1.1 Definition of Rational Numbers: What are rational numbers? A number that can be written as, where p and q are integers and q Number. 0, is known as Rational Example:, 12, -18 etc.

More information

NUMBERS AND CODES CHAPTER Numbers

NUMBERS AND CODES CHAPTER Numbers CHAPTER 2 NUMBERS AND CODES 2.1 Numbers When a number such as 101 is given, it is impossible to determine its numerical value. Some may say it is five. Others may say it is one hundred and one. Could it

More information

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018 DIGITAL ELECTRONICS SYSTEM DESIGN LL 2018 PROFS. IRIS BAHAR & ROD BERESFORD NOVEMBER 9, 2018 LECTURE 19: BINARY ADDITION, UNSIGNED BINARY NUMBERS For the binary number b n-1 b n-2 b 1 b 0. b -1 b -2 b

More information

Introduction to Quantum Computation

Introduction to Quantum Computation Introduction to Quantum Computation Ioan Burda Introduction to Quantum Computation Copyright 2005 Ioan Burda All rights reserved. Universal Publishers Boca Raton, Florida USA 2005 ISBN: 1-58112- 466-X

More information

2 ways to write the same number: 6,500: standard form 6.5 x 10 3 : scientific notation

2 ways to write the same number: 6,500: standard form 6.5 x 10 3 : scientific notation greater than or equal to one, and less than 10 positive exponents: numbers greater than 1 negative exponents: numbers less than 1, (> 0) (fractions) 2 ways to write the same number: 6,500: standard form

More information

LABORATORY MANUAL MICROPROCESSOR AND MICROCONTROLLER

LABORATORY MANUAL MICROPROCESSOR AND MICROCONTROLLER LABORATORY MANUAL S u b j e c t : MICROPROCESSOR AND MICROCONTROLLER TE (E lectr onics) ( S e m V ) 1 I n d e x Serial No T i tl e P a g e N o M i c r o p r o c e s s o r 8 0 8 5 1 8 Bit Addition by Direct

More information

EDULABZ INTERNATIONAL NUMBER SYSTEM

EDULABZ INTERNATIONAL NUMBER SYSTEM NUMBER SYSTEM 1. Find the product of the place value of 8 and the face value of 7 in the number 7801. Ans. Place value of 8 in 7801 = 800, Face value of 7 in 7801 = 7 Required product = 800 7 = 00. How

More information

Chapter 1: Solutions to Exercises

Chapter 1: Solutions to Exercises 1 DIGITAL ARITHMETIC Miloš D. Ercegovac and Tomás Lang Morgan Kaufmann Publishers, an imprint of Elsevier, c 2004 Exercise 1.1 (a) 1. 9 bits since 2 8 297 2 9 2. 3 radix-8 digits since 8 2 297 8 3 3. 3

More information

CprE 281: Digital Logic

CprE 281: Digital Logic CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/ Signed Numbers CprE 281: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev Administrative

More information

1 1. Basic Math Whole numbers Fractions Decimals Advanced Math

1 1. Basic Math Whole numbers Fractions Decimals Advanced Math Unit. Mathematics. Basic Math... 00. Whole numbers... 00. Fractions... 3 003. Decimals... 7. Advanced Math... 6 004. Ratios... 6 005. Proportion... 9 006. Positive and negative numbers... 9 007. Powers

More information

A group of figures, representing a number, is called a numeral. Numbers are divided into the following types.

A group of figures, representing a number, is called a numeral. Numbers are divided into the following types. 1. Number System Quantitative Aptitude deals mainly with the different topics in Arithmetic, which is the science which deals with the relations of numbers to one another. It includes all the methods that

More information

The goal differs from prime factorization. Prime factorization would initialize all divisors to be prime numbers instead of integers*

The goal differs from prime factorization. Prime factorization would initialize all divisors to be prime numbers instead of integers* Quantum Algorithm Processor For Finding Exact Divisors Professor J R Burger Summary Wiring diagrams are given for a quantum algorithm processor in CMOS to compute, in parallel, all divisors of an n-bit

More information

CSE 20: Discrete Mathematics

CSE 20: Discrete Mathematics Spring 2018 Summary So far: Today: Logic and proofs Divisibility, modular arithmetics Number Systems More logic definitions and proofs Reading: All of Chap. 1 + Chap 4.1, 4.2. Divisibility P = 5 divides

More information

Dividing Polynomials: Remainder and Factor Theorems

Dividing Polynomials: Remainder and Factor Theorems Dividing Polynomials: Remainder and Factor Theorems When we divide one polynomial by another, we obtain a quotient and a remainder. If the remainder is zero, then the divisor is a factor of the dividend.

More information

Logic Theory in Designing of Digital Circuit & Microprocessor

Logic Theory in Designing of Digital Circuit & Microprocessor Logic Theory in Designing of Digital Circuit & Microprocessor Prof.Vikram Mahendra Kakade Assistant Professor, Electronics & Telecommunication Engineering Department, Prof Ram Meghe College of Engineering

More information

Decimal Addition: Remember to line up the decimals before adding. Bring the decimal straight down in your answer.

Decimal Addition: Remember to line up the decimals before adding. Bring the decimal straight down in your answer. Summer Packet th into 6 th grade Name Addition Find the sum of the two numbers in each problem. Show all work.. 62 2. 20. 726 + + 2 + 26 + 6 6 Decimal Addition: Remember to line up the decimals before

More information

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit Digital Techniques 1. Binary System The digital computer is the best example of a digital system. A main characteristic of digital system is its ability to manipulate discrete elements of information.

More information

0 / 1 Now, Binary value of the given number :-

0 / 1 Now, Binary value of the given number :- Course Code : MCS-012 Course Title : Computer Organisation and Assembly Language Programming Assignment Number : MCA(1)/012/Assign/2014-15 Maximum Marks : 100 Weightage : 25% Last Dates for Submission

More information

Contents. Chapter 2 Digital Circuits Page 1 of 30

Contents. Chapter 2 Digital Circuits Page 1 of 30 Chapter 2 Digital Circuits Page 1 of 30 Contents Contents... 1 2 Digital Circuits... 2 2.1 Binary Numbers... 2 2.2 Binary Switch... 4 2.3 Basic Logic Operators and Logic Expressions... 5 2.4 Truth Tables...

More information

Carry Look Ahead Adders

Carry Look Ahead Adders Carry Look Ahead Adders Lesson Objectives: The objectives of this lesson are to learn about: 1. Carry Look Ahead Adder circuit. 2. Binary Parallel Adder/Subtractor circuit. 3. BCD adder circuit. 4. Binary

More information

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C.

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C. Numbers & Arithmetic Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See: P&H Chapter 2.4-2.6, 3.2, C.5 C.6 Example: Big Picture Computer System Organization and Programming

More information

Binary addition (1-bit) P Q Y = P + Q Comments Carry = Carry = Carry = Carry = 1 P Q

Binary addition (1-bit) P Q Y = P + Q Comments Carry = Carry = Carry = Carry = 1 P Q Digital Arithmetic In Chapter 2, we have discussed number systems such as binary, hexadecimal, decimal, and octal. We have also discussed sign representation techniques, for example, sign-bit representation

More information

Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS

Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS CS131 Part I, Number Systems CS131 Mathematics for Computer Scientists II Note 1 INTEGERS The set of all integers will be denoted by Z. So Z = {..., 2, 1, 0, 1, 2,...}. The decimal number system uses the

More information

1 Computing System 2. 2 Data Representation Number Systems 22

1 Computing System 2. 2 Data Representation Number Systems 22 Chapter 4: Computing System & Data Representation Christian Jacob 1 Computing System 2 1.1 Abacus 3 2 Data Representation 19 3 Number Systems 22 3.1 Important Number Systems for Computers 24 3.2 Decimal

More information

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013 Fall 2013 Student Responsibilities Reading: Textbook, Section 3.7, 4.1, & 5.2 Assignments: Sections 3.6, 3.7, 4.1 Proof Worksheets Attendance: Strongly Encouraged Overview 3.6 Integers and Algorithms 3.7

More information

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute DIGITAL TECHNICS Dr. Bálint Pődör Óbuda University, Microelectronics and Technology Institute 4. LECTURE: COMBINATIONAL LOGIC DESIGN: ARITHMETICS (THROUGH EXAMPLES) 2016/2017 COMBINATIONAL LOGIC DESIGN:

More information

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd() Student Responsibilities Week 8 Mat 2345 Week 8 Reading: Textbook, Section 3.7, 4.1, & 5.2 Assignments: Sections 3.6, 3.7, 4.1 Induction Proof Worksheets Attendance: Strongly Encouraged Fall 2013 Week

More information

Mark Redekopp, All rights reserved. Lecture 1 Slides. Intro Number Systems Logic Functions

Mark Redekopp, All rights reserved. Lecture 1 Slides. Intro Number Systems Logic Functions Lecture Slides Intro Number Systems Logic Functions EE 0 in Context EE 0 EE 20L Logic Design Fundamentals Logic Design, CAD Tools, Lab tools, Project EE 357 EE 457 Computer Architecture Using the logic

More information

6.111 Lecture # 12. Binary arithmetic: most operations are familiar Each place in a binary number has value 2 n

6.111 Lecture # 12. Binary arithmetic: most operations are familiar Each place in a binary number has value 2 n 6.111 Lecture # 12 Binary arithmetic: most operations are familiar Each place in a binary number has value 2 n Representation of negative numbers: there are a number of ways we might do this: 5 = 00000101

More information

COMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING UNIT 3 - ARITMETHIC-LOGIC UNIT JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ

COMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING UNIT 3 - ARITMETHIC-LOGIC UNIT JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ OMUTERS ORGANIZATION 2ND YEAR OMUTE SIENE MANAGEMENT ENGINEERING UNIT 3 - ARITMETHI-LOGI UNIT JOSÉ GARÍA RODRÍGUEZ JOSÉ ANTONIO SERRA ÉREZ Tema 3. La Unidad entral de roceso. A.L.U. Arithmetic Logic Unit

More information

Digital Electronics Circuits 2017

Digital Electronics Circuits 2017 JSS SCIENCE AND TECHNOLOGY UNIVERSITY Digital Electronics Circuits (EC37L) Lab in-charge: Dr. Shankraiah Course outcomes: After the completion of laboratory the student will be able to, 1. Simplify, design

More information

Computer Architecture 10. Residue Number Systems

Computer Architecture 10. Residue Number Systems Computer Architecture 10 Residue Number Systems Ma d e wi t h Op e n Of f i c e. o r g 1 A Puzzle What number has the reminders 2, 3 and 2 when divided by the numbers 7, 5 and 3? x mod 7 = 2 x mod 5 =

More information

3 The fundamentals: Algorithms, the integers, and matrices

3 The fundamentals: Algorithms, the integers, and matrices 3 The fundamentals: Algorithms, the integers, and matrices 3.4 The integers and division This section introduces the basics of number theory number theory is the part of mathematics involving integers

More information