NUMBER SYSTEMS. and DATA REPRESENTATION. for COMPUTERS (PROBLEM ANSWERS)

Size: px
Start display at page:

Download "NUMBER SYSTEMS. and DATA REPRESENTATION. for COMPUTERS (PROBLEM ANSWERS)"

Transcription

1 NUMBER SYSTEMS and DATA REPRESENTATION for COMPUTERS (PROBLEM ANSWERS) 05 March 2008

2 Number Systems and Data Representation 2 Table of Contents Table of Contents... 2 Conversion Between Binary and Hexadecimal Answers... 3 Convert Single Digit Hexadecimal to Binary by Inspection...3 Convert Binary to Hexadecimal...3 Convert Hexadecimal to Binary...3 Data Representation Answers... 4 Character Code Problems...4 Jubilation Code and Gran Zeff Code Problems...6 Conversion to and from Decimal Answers... 8 Number Systems Conversion Answers...0 String Function Answers... Hexadecimal Addition Answers...3 Convert to IBM BCD Answers...4 Fixed Point Conversion Answers...5 Partitioned Numbers...6 Subnet Answers...6 German Roman Numeral Answers...8 Fibonacci Bases Answers...20 Phi Base Number System Answers...23 Continued Fraction Answer...24 Complement Arithmetic Answers...25 Fast Two s Complement Answers...25 Binary Multiplication Answer...26 Hexadecimal Multiplication Answer...26 Fixed Point Binary Division Answers...27 Prime Number Answers...27 Scientific Notation Conversion Answers...28 Scientific Notation Multiplication Answers...28 Floating Point Conversion Answers...29 There are three kinds of mathematicians: those who can count, and those who can t. Attributed to the famous mathematician E. Bombieri. Albert R. Meyer, Problems on Equational Proof Systems, M.I.T. (8 October 998). Visited 2 January 2008.

3 Number Systems and Data Representation 3 Conversion Between Binary and Hexadecimal Answers Convert Single Digit Hexadecimal to Binary by Inspection Problem Problem Problem Problem Problem Problem 6. 2 Convert Binary to Hexadecimal Problem 7. D 6 Problem Problem Problem Problem. 0 6 Problem 2. 6B85 6 Convert Hexadecimal to Binary Problem 3. 00:0 2 Problem 4. 0:00:0 2 Problem :00:00:000::00 2 Problem :0000:0:0:0 2

4 Number Systems and Data Representation 4 Data Representation Answers Character Code Problems Problem A. 2 Zoos Character 2 Z o o s EBCDIC F2 40 E A2 Binary : :0000 0:00 00:00 00:00 00:000 Character 2 Z o o s ASCII A 6F 6F 73 Binary 00: : :00 00: 00: 0:00 Problem A2. Bill Character B i l l EBCDIC F 40 C Binary : : : :00 00:00 00:00 Character B i l l ASCII C 6C Binary 00: : :000 00:00 00:00 00:00 Problem A3. Hi Ho 0 lo? Notes: Hi are letters. Ho are letters. 0 are numbers. lo are letters, followed by punctuation. Character H i H o EBCDIC C C Binary 00: :00 000: :000 00:00 000:0000 ASCII F 20 Binary 000:000 00:00 000: :000 00: 000:0000 Character 0 l O? EBCDIC F F D6 6F Binary :000 : : :00 0:00 00: ASCII C 4F 3F Binary 00:000 00: : :00 000: 00:

5 Number Systems and Data Representation 5 Problem A4. 2ZS50Oo li. 2ZS5 Number, Letter, Letter, Number 0Oo Number, Letter, Letter li. Number, Letter, Letter, Punctuation Character 2 Z S 5 0 O EBCDIC F2 E9 E2 F5 F0 D6 Binary :000 0:00 0:000 :00 :0000 0:00 ASCII 32 5A F Binary 00:000 00:00 00:00 00:00 00: : Character o l i. EBCDIC F Binary 00:00 000:0000 :000 00:00 000:00 0:00 ASCII 6F C 69 2E Binary 00: 000: :000 00:00 00:00 000:0 Problem A5. Code the following in hexadecimal using ASCII and then convert to binary. Character O v e n ASCII Hex 4F E ASCII Binary 000: 0:00 00:00 00:0 EBCDIC Hex D6 A EBCDIC Binary 0:00 00:00 000:00 00:00 Character H o t ASCII Hex F 74 ASCII Binary 000: :000 00: 0:000 EBCDIC Hex A3 EBCDIC Binary 000: :000 00:00 00:00

6 Number Systems and Data Representation 6 Problem A6. Code the following in hexadecimal using EBCDIC and then convert to binary. Character 0 i ASCII Hex ASCII Binary 00:000 00: : :00 EBCDIC Hex F F EBCDIC Binary :000 : : :00 Character s l o ASCII Hex C 6F ASCII Binary 0:00 000: :00 00: EBCDIC Hex A EBCDIC Binary 00: : :00 00:00 Problem A7. Convert the following to hexadecimal and then to characters using EBCDIC code. Binary : :0000 0:000 00:000 00:000 00:0 EBCDIC Hex F 40 D A Character J u m p Jubilation Code and Gran Zeff Code Problems Problem B. Code the word adelfos (brother) from SECRET SYMBOL to JUBILATION CODE hexadecimal, and then to JUBILATION CODE binary. a d e l f o s A A4 B C3 F2 D3 E2 00:000 00:000 0:000 00:00 :000 0:00 0:000 Problem B2. Code the word dwron (gift) from SECRET SYMBOL to GRAN ZEFF CODE hexadecimal, and then to GRAN ZEFF CODE binary. d w r o n :000 00:00 000:00 0:0 0:00

7 Number Systems and Data Representation 7 Problem B3. Code the word sofos (wise) from SECRET SYMBOL to UNICODE hexadecimal, and then to UNICODE binary. s o f o s 03C3 03BF 03C6 03BF 03C2 0000:00: 00: :00: 0: 0000:00: 00: :00: 0: 0000:00: 00:000 Problem B4. Code the word kardia (heart) from SECRET SYMBOL to UNICODE hexadecimal, and then to UNICODE binary. k a r d i a 03BA 03B 03C 03B4 03B9 03B 0000:00: 0: :00: 0: :00: 00: :00: 0: :00: 0:00 Problem B5. Code the JUBILATION CODE binary into JUBILATION CODE hexadecimal, and then to SECRET SYMBOL. (death) 0000:00: 0:000 0:000 00:000 0:000 00:000 0:000 0:00 0:000 B4 A D A E4 D3 E2 q a n a t o s Problem B6. Code the GRAN ZEFF CODE binary into GRAN ZEFF CODE hexadecimal, and then to SECRET SYMBOL. (wicked) 0:000 0:0 0:00 00:0 000:00 0:0 000: p o n h r o s Problem B7. Code the UNICODE binary into UNICODE hexadecimal, and then into SECRET SYMBOL. (nation) 0000:00: 0: :00: 0: :00: 0:0 0000:00: 0: 0000:00: 00:000 03B5 03B8 03BD 03BF 03C2 e q n o s

8 Number Systems and Data Representation 8 Conversion to and from Decimal Answers Conversion to Decimal Answers Problem A. 6 0 Problem A Problem A Problem A Problem A Problem A6.,359 0 Problem A Problem A Common Answer Table for Conversion from Decimal: Problems B through B6 Between Base 4, Binary, and Hexadecimal: Problem B7 Between Octal and Binary: Problem B8

9 Number Systems and Data Representation 9 Column A B C D Row Decimal Binary Hexadecimal Base 4 Octal 3 : F : :00 A :00 A :0000: :0:0 BD :0: DF :00:000 2C Column A B C D Row Decimal Binary Hexadecimal Base 4 Octal 3 B B3 B5 B B B3 B5 B B B3 B5 B B B3 B5 B B4 B2 B7 B B4 B2 B7 B B4 B2 B7 B B4 B2 B7 B8

10 Number Systems Conversion Answers Problem. Convert the following decimal numbers to binary. Problem Decimal Hexadecimal Binary a H b 240 F0H 0000 c 6 3DH 0 d 202 CAH Problem 2. Convert the following decimal numbers to hexadecimal. Problem Decimal Hexadecimal Binary 2a 37 25H b 222 DEH 0 0 2c 68 A8H d 959 3BFH 0 Problem 3. Convert the following numbers to decimal. Problem Binary Hexadecimal Decimal 3a 0 0 D7H 25 3b H 2 3c 0 0 EBH 235 3d 7FH 27

11 Number Systems and Data Representation String Function Answers Problem. Length. Let x = B l e s s e d a r e t h e p o o r l Find k = LEN(x) = 20 Problem 2. Concatenation. Let x = B e l y = P r e p a r e d l Concatenate x and y. z = x & y. z = B e P r e p a r e d l Problem 3. Left. Let x = B l e s s e d a r e t h e p o o r l Find y = Left(x,5). y = B l e s s l Problem 4. Right. Let x = B l e s s e d a r e t h e p o o r l Find y = Right(x,8). y = t h e p o o r l Problem 5. MID. Let x = B l e s s e d a r e t h e p o o r l Find y = MID(x,4,2) y = h e l Problem 6. Comparison. Let x = B l e s s e d a r e t h e p o o r l y = B l e s s e d a r e t h e m e e k l If x < y Answer is False. Problem 7. Search. x = B e h o l d, I b r i n g g l a d l y = h o l d l k = FIND(x,y) = 3

12 Number Systems and Data Representation 2 Problem 8. Search. x = t i d i n g s. Y o u s h a l l l y = y o u l Search only for whole words; permit upper or lower case. k = FIND(x,y) = 0 Problem 9. Compound Function x = B l e s s e d a r e t h e p o o r l y = P r e p a r e d l Find z = LEFT(x,5) & MID(x,3,3) & y z = B l e s s t h e P r e p a r e d l Problem 0. Compound Function x = B e b r a v e. B e s t r o n g. B e r e a d y. B e a l e r t. l y = B e l Find z = RIGHT(x, LEN(x) LEN(y) FIND(x,y, FIND(x,y, FIND(x,y)+LEN(y))+LEN(y))) z = Solution: z = RIGHT(x, LEN(x) LEN(y) FIND(x,y, FIND(x,y, FIND(x,y)+LEN(y))+LEN(y))) j = FIND(x, y) = k = LEN(y) = 2 z = RIGHT(x, LEN(x) LEN(y) FIND(x,y, FIND(x,y, +2)+LEN(y))) z = RIGHT(x, LEN(x) LEN(y) FIND(x,y, FIND(x,y, 3)+LEN(y))) FIND(x,y, 3) = z = RIGHT(x, LEN(x) LEN(y) FIND(x,y, +LEN(y))) z = RIGHT(x, LEN(x) LEN(y) FIND(x,y, +2)) z = RIGHT(x, LEN(x) LEN(y) FIND(x,y, 3)) m = LEN(x) = 40 z = RIGHT(x, 40 2 FIND(x,y, 3)) = RIGHT(x, 38 FIND(x,y, 3)) FIND(x,y, 3) = 22 z = RIGHT(x, 38 22) = RIGHT(x, 6) z = r e a d y. B e a l e r t. l

13 Number Systems and Data Representation 3 Hexadecimal Addition Answers Problem. 0 6 Throw away Problem Throw away Problem 3. F96H No throw away Problem 4. 86ECH No throw away Problem 5. E00D 6 No throw away Problem 6. 0C63 6 No throw away

14 Number Systems and Data Representation 4 Convert to IBM BCD Answers Problem. Convert ASCII -736 to IBM Unpacked BCD Z d Z d S d Problem 2. Convert ASCII -736 to IBM Packed BCD d d d S

15 Number Systems and Data Representation 5 Fixed Point Conversion Answers Problem. Problem 2. Problem = Problem = = 3B5.34H FED.CAB 6 = B Problem 5. AD.E 6 = Problem = AE.C2H

16 Number Systems and Data Representation 6 Partitioned Numbers Problem A. a. Left partition = 60 b. Right partition = 22 c. Sum = 82 Problem A2. a. Left partition = 96 b. Right partition = 2 c. Sum = 08 Subnet Answers Problem B. Convert the dotted decimal for IP address to binary and hexadecimal, using the table below A 7 F 0 5 Problem B2. How many subnet addresses are possible in the subnet mask shown below? x x x x x x x x x y y y y y y y y y y y y y y y x = FF = = 5. The number of subnet addresses is 52, where 0 is one of the possible addresses. (0 5) Problem B3. How many host machine addresses are possible for each subnet in the subnet mask shown below? x x x x x x x x x y y y y y y y y y y y y y y y y = 7FFFH = = The number of host machine addresses is Recall that 0 is one of the possible addresses. ( ). The number of host machines that can be on that subnet is two less than the number of possible addresses, or = Problem B4. How many bits in the below mask need to be set aside to make sure each subnet can have at least 283 host machines? x x x x x x x x x x x x x x x y y y y y y y y y 9 bits are needed. 8 bits gives only 256 addresses (0 255). 9 bits gives 52 addresses, which is at least is the smallest power of two greater than or equal to 283.

17 Number Systems and Data Representation 7 Problem B5. How many subnet addresses are possible in the below mask if enough bits are set aside to make sure each subnet can have at least 283 host machines? x x x x x x x x x x x x x x x y y y y y y y y y 5 bits are available for subnet addresses if enough bits (9) are set aside for host machine addresses. This yields different addresses ( ). Problem B6. What is the dotted decimal notation for the subnet mask needed for ensuring enough bits are set aside to ensure each subnet can have at least 283 host machines? x x x x x x x x x x x x x x x The bits in the subnet mask coded with and x are turned on. Bits coded 0 are turned off. The subnet mask in dotted decimal notation is

18 Number Systems and Data Representation 8 German Roman Numeral Answers Problem. Write 390 B.C. in Roman numerals. B.C. CCCXC Zero and negative numbers do not exist in Roman numerals. We attach Another representation is XCD B.C. 500 is D. 400 is CD, which is 00 less than is XCD, which is 0 less than 400. Ambiguity: This is ambiguous because Roman numerals are not associative. XC is 90 (XC)D is 40 Only if you scan from right to left is your answer unique. Problem 2. Write 407 A.D. in Roman numerals. CDVII A.D. We attach A.D. 500 is D. 400 is CD, which is 00 less than is CDVII, which is 7 more than 400. Problem 3. Write 255 in Roman numerals. CCLV. 200 is CC. 250 is CCL. 255 is CCLV. Problem 4. Add XI and XXXII. Group similar letters together, while maintaining the relative position of letters. Simplify by substituting aggregate symbols. XXXX III XLIII The purpose of this problem is to illustrate that addition was fairly simple for the Romans. Problem 5. XXV is 25. Time to get the clock fixed. Problem 6. Zero cannot be represented by Roman numerals. It lacks nothing. Problem 7. Divide XXX by VI. I do not know of an easy way of doing division using Roman numerals. Roman engineers used a calculating board or an abacus for doing arithmetic and translated the answers into Roman numerals. One approach would be to expand both to all ones, and group the ones. Likewise, they needed some way of doing multiplication. You can see that calculation with Roman numerals is not as easy as calculation using our positional number system. XXX = 30, VI = 6. 30/6 = 5 = V. So, the Roman numeral system was good for enumeration, counting, and addition.

19 Number Systems and Data Representation 9 Problem 8. MDCCLXXVI Americans: You should recognize the answer after you decode it. Problem 9. I(VL) = 54 = 44 Problem 0. (IV)L = 50 4 = 46

20 Number Systems and Data Representation 20 Fibonacci Bases Answers Problem. Convert 50 0 to Minimal Fibonacci Base (Zeckendorf) Representation Remainder R F 4 F 3 F 2 F F 0 F 9 F 8 F 7 F 6 F 5 F 4 F 3 F 2 Fibonacci Number place values digits decimal values Remainder R Problem 2. Convert 53 0 to Minimal Fibonacci Base (Zeckendorf) Representation Remainder R F 4 F 3 F 2 F F 0 F 9 F 8 F 7 F 6 F 5 F 4 F 3 F 2 Fibonacci Number place values digits decimal values Remainder R If you add the Zeckendorf Representation numbers for , you get: F 5 F 4 F 3 F 2 F F 0 F 9 F 8 F 7 F 6 F 5 F 4 F 3 F 2 Fibonacci Number place values X Y Answer decimal values

21 Number Systems and Data Representation 2 Converting this Fibonacci Base Representation to a Minimal Fibonacci Base Representation: F 4 F 3 F 2 F F 0 F 9 F 8 F 7 F 6 F 5 F 4 F 3 F 2 Fibonacci Number place values Answer Rule Rule 0 0 Rule Rule Rule Rule Rule Rule Rule Rule 2 The answer is Fib To check the answer, this is ( x 89) + ( x 3) + ( x ) = 03 0 Problem 3. Add the two Zeckendorf Representation numbers: Fib Fib F 5 F 4 F 3 F 2 F F 0 F 9 F 8 F 7 F 6 F 5 F 4 F 3 F 2 Fibonacci Number place values X Y Answer decimal values The sum is 67 0 Converting this Fibonacci Base Representation to a Minimal Fibonacci Base Representation:

22 Number Systems and Data Representation 22 F 5 F 4 F 3 F 2 F F 0 F 9 F 8 F 7 F 6 F 5 F 4 F 3 F 2 Fibonacci Number place values Answer Rule Rule Rule Rule Rule Rule Rule Rule Rule Rule Rule Rule Rule Rule Rule Rule Rule 2 The answer is Fib Converted to decimal, it is: ( x 60) + ( x 5) + ( x 2) = 67 0 Problem 4. Restore Fibonacci Base Representation 002 Fib to Minimal Fibonacci Base Representation. F 4 F 3 F 2 F F 0 F 9 F 8 F 7 F 6 F 5 F 4 F 3 F 2 Fibonacci Number place values Answer Rule Rule Rule Rule Rule Rule Rule 2 The answer is Fib Converted to decimal, it is ( x 55) + ( x 5) + ( x 2) = 62 0

23 Number Systems and Data Representation 23 Phi Base Number System Answers Problem. Express A = Φ 4 + Φ 3 + Φ -3 as phigits: F 6 F 5 F 4 F 3 F 2 F F 0. F - F -2 F -3 F -4 F -5 F -6 A = Problem 2. Express B = Φ 4 + Φ + Φ -4 + Φ -6 as phigits: F 6 F 5 F 4 F 3 F 2 F F 0. F - F -2 F -3 F -4 F -5 F -6 B = Problem 3. Add the phigits A (from Problem ) and B (from Problem 2). F 6 F 5 F 4 F 3 F 2 F F 0. F - F -2 F -3 F -4 F -5 F -6 A = B = A+B= Problem 4. Transform the sum, A+B, computed in Problem 3 into minimal Phi base representation. In the left column, write the rule number being used for each step of the transformation. F 6 F 5 F 4 F 3 F 2 F F 0. F - F -2 F -3 F -4 F -5 F -6 A+B= R# R# R# Problem 5. In the answer to Problem 4, substitute expressions for F n in terms of n and f. Reduce the expression to the fewest number of terms. Φ 6 + Φ + Φ -2 + Φ -6 = 3+8ϕ + +ϕ + -ϕ + 5-8ϕ = ϕ = 20

24 Number Systems and Data Representation 24 Continued Fraction Answer Problem. Evaluate the first six terms. Show all your steps = = = = X = + = + + = K The 6-term continued fraction approximation to the golden ratio is.625. By comparison, the ten digit approximation of the golden ratio is Compute as follows: () Enter (2) x + (3) Repeat step (2) four times

25 Number Systems and Data Representation 25 Complement Arithmetic Answers Problem. 8 Problem Problem 3. 20C 6 Problem D 6 Problem Problem Fast Two s Complement Answers Problem. Consider the binary number a. The right-most -bit is in bit position 2. b. Leave bit positions 2,, and 0 alone. c. The two s complement of this binary number is Problem 2. Consider the binary number a. The right-most -bit is in bit position 4. b. Leave bit positions 4, 3, 2,, and 0 alone. c. The two s complement of this binary number is

26 Binary Multiplication Answer Column Position Number X 0 Y 0 0 Carry Column Column 0 Column 2 0 Column Column 4 0 Sum Check the answer by converting to decimal. Place Value Sum The answer is 638. Hexadecimal Multiplication Answer Problem. Multiply X = FADH times EB 6. Sum Carry 2 Carry term A 6 8 Carry term 2 D 8 B X F A D times Y E B 5 E F 2 C 6 Answer E 6 3 C F Answer = E63CFH = 953,055 0.

27 Number Systems and Data Representation 27 Fixed Point Binary Division Answers Problem. Divide by The answer is. 2 Prime Number Answers Problem. a. Show that 7 is a prime number using base 2. b. Show that 7 is a prime number using base 3. c. Compare the results. a. Demonstrate 7 is a prime number using base 2. Divide by R 3 = R 0 =2 R 3 = R 3 = R 0 = R 0 Divide by 7 R 3 = 0 R 0 =0

28 Number Systems and Data Representation 28 The first integer that evenly divides 2 is 2. Therefore, 2 = 7 0 is a prime number. b. Demonstrate that 7 is a prime number using base 3. Divide by R 3 = R 3 = 2 0 R 0 = R 0 =2 R 3 = R 0 = Divide by R 3 = 0 R 0 =0 The first integer that divides 2 3 evenly is 2 3. Therefore, 2 3 = 7 0 is a prime number. c. In both problems, the equivalent of 7 0 is a prime number. Scientific Notation Conversion Answers Problem x 0 34 J/s is Plank s constant. Problem x 0 8 m/s is the speed of light in a vacuum. Scientific Notation Multiplication Answers Problem. Approximate the distance of one light-year: ( x 0 8 m/s ) x (3.47 x 0 7 s/yr ) x ( yr) = x 0 5 m = x 0 2 km Problem 2. Naively estimate the kinetic energy of the earth revolving around the Sun, assuming a circular orbit (ignoring Kepler): (/2) x (5.98 x 0 24 kg ) x ( 2.99 x 0 4 m/s ) 2 = 2.67 x 0 33 J

29 Number Systems and Data Representation 29 Floating Point Conversion Answers Problem. IEEE Single Precision Floating Point S Characteristic Mantissa Mantissa (Continued) Procedure: Step : Let M = (IEEE Single Precision Floating Point characteristic) (IEEE Single Precision Floating Point Excess). M = = 2. Note: The IEEE format uses implicit normalization. The radix point is immediately to the left of the IEEE mantissa most significant bit. Step 2: Insert the prefix bit pattern 000 immediately to the left of the radix point Step 3: Let MM = M MOD 4. This is the remainder obtained by dividing M by 4. MM = 2 MOD 4 = 2. Step 4: Compute the number of bits (J) to right-shift the mantissa and prefix bit pattern. If MM = 0, then J = 4. If MM < 0, then J = MM. MM is the absolute value of MM. If MM > 0, then J = 4 MM. J = 4 2 = 2. The number of bits of precision in the mantissa lost is J = 2 =. Step 5: Copy the shifted bit pattern into the IBM Short HFP mantissa. Step 6: Compute the IBM HFP characteristic, without excess K = M = =.5 = 4 = 4 4. Step 7: Add the IBM HFP excess to K and store it in the HFP characteristic field. K + 64 = 65 = 4 6 = Step 8: Copy the sign bit from the IEEE Single Precision FP word to the sign bit of the IBM HFP word. IBM Hexadecimal Short Floating Point S Characteristic Mantissa

30 Number Systems and Data Representation 30 Mantissa (Continued) Problem 2. IEEE Single Precision Floating Point S Characteristic Mantissa Mantissa (Continued) Procedure: Step : Let M = (IEEE Single Precision Floating Point characteristic) (IEEE Single Precision Floating Point Excess). M = = 5. Note: The IEEE format uses implicit normalization. The radix point is immediately to the left of the IEEE mantissa most significant bit. Step 2: Insert the prefix bit pattern 000 immediately to the left of the radix point Step 3: Let MM = M MOD 4. This is the remainder obtained by dividing M by 4. MM = 5 MOD 4 =. Step 4: Compute the number of bits (J) to right-shift the mantissa and prefix bit pattern. If MM = 0, then J = 4 If MM < 0, then J = MM. MM is the absolute value of MM. If MM > 0, then J = 4 MM = 4 = 3. The number of bits of precision in the mantissa lost is J = 3 = 2. Step 5: Copy the shifted bit pattern into the IBM Short HFP mantissa. Step 6: Compute the IBM HFP characteristic, without excess K = M = = 2.25 = 2 4 = 4 4. Step 7: Add the IBM HFP excess to K and store it in the HFP characteristic field. K + 64 = = 66 = 42 6 = Step 8: Copy the sign bit from the IEEE Single Precision FP word to the sign bit of the IBM HFP word. IBM Hexadecimal Short Floating Point S Characteristic Mantissa

31 Number Systems and Data Representation 3 Mantissa (Continued) Problem 3. IEEE Single Precision Floating Point S Characteristic Mantissa Mantissa (Continued) Procedure: Step : Let M = (IEEE Single Precision Floating Point characteristic) (IEEE Single Precision Floating Point Excess). M = = - 2. Note: The IEEE format uses implicit normalization. The radix point is immediately to the left of the IEEE mantissa most significant bit. Step 2: Insert the prefix bit pattern 000 immediately to the left of the radix point Step 3: Let MM = M MOD 4. This is the remainder obtained by dividing M by 4. MM = -2 MOD 4 = -2. Step 4: Compute the number of bits (J) to right-shift the mantissa and prefix bit pattern. If MM = 0, then J = 4 If MM < 0, then J = MM. J = -2 = 2. If MM > 0, then J = 4 MM. The number of bits of precision in the mantissa lost is J = 2 =. Step 5: Copy the shifted bit pattern into the IBM Short HFP mantissa. Step 6: Compute the IBM HFP characteristic, without excess K = M = = 0.5 = 0 4 = 4 4. Step 7: Add the IBM HFP excess to K and store it in the HFP characteristic field. K + 64 = = 64 = 40 6 = Step 8: Copy the sign bit from the IEEE Single Precision FP word to the sign bit of the IBM HFP word. IBM Hexadecimal Short Floating Point S Characteristic Mantissa

32 Number Systems and Data Representation 32 Mantissa (Continued) Problem 4. IBM Hexadecimal Extended Floating Point High Order Word S High Order Characteristic High Order Mantissa High Order Mantissa (Continued ) High Order Mantissa (Continued 2) High Order Mantissa (Continued 3) Low Order Word S Low Order Characteristic Low Order Mantissa Low Order Mantissa (Continued ) Low Order Mantissa (Continued 2) Low Order Mantissa (Continued 3) Procedure: Step : Subtract the IBM Hexadecimal Floating Point Excess from the high order characteristic. Step 2: Let K = the numerical value of the high order characteristic. K = = 0

33 Number Systems and Data Representation 33 Step 3: Step 4: Let N = 4 K. Each positive increment of the IBM Hexadecimal Floating Point characteristic represents a shift of the radix by 4 bit positions to the left to perform the normalization. N = 4 x 0 = 40. Let J = the number of bit positions from the left end of the mantissa occupied by the first one-bit. J = 4. Step 5: Let P = N J = 40 4 = 36. Step 6: Add the IEEE Double Extended Precision Floating Point Excess to P. M = P + XS IEEE DEP FP = = 649. Step 7: Convert M to binary. 649 = = Step 8: Step 9: Step 0: Step : Record the result in the characteristic field of the IEEE Double Extended Precision Floating Point word. The most significant bit of the mantissa of the IBM Hexadecimal Floating Point becomes the implicit bit in the IEEE Double Extended Precision Floating Point word, and therefore does not explicitly get recorded. Beginning with the bit immediately to the right of the most significant bit, copy the remaining bits from the IBM Hexadecimal Floating Point mantissa into the IEEE Double Extended Precision Floating Point mantissa. Stop after the IEEE Double Extended Precision Floating Point mantissa is filled. Note that 44 to 47 least-significant-bits of precision in the mantissa were lost in the conversion. The number of bits of precision lost is 48 J = 48 4 = 44. IEEE Double Extended Precision Floating Point S Characteristic Mantissa Mantissa (Continuation ) Mantissa (Continuation 2) Mantissa (Continuation 3)

34 Number Systems and Data Representation 34 Problem 5. Convert the following IEEE Double Extended Precision Floating Point word to an IBM Hexadecimal Extended Floating Point word. IEEE Double Extended Precision Floating Point S Characteristic Mantissa Mantissa (Continuation ) Mantissa (Continuation 2) Mantissa (Continuation 3) Procedure: Step : Step 2: Step 3: Step 4: Step 5: Step 6: Step 7: Step 8: Step 9: Set all IBM Hexadecimal Extended Floating Point bits to zero. Copy the IEEE Double Extended Precision Floating Point sign bit into the IBM Hexadecimal Extended Floating Point High Order sign bit and Low Order sign bit. Evaluate the IEEE Double Extended Precision Floating Point Excess from the characteristic. 3F4A 6 = (3 x 6 3 ) + ( F x 6 2 ) + ( 4 x 6 ) + (A x 6 0 ) = = Subtract the IEEE Double Extended Precision Floating Point Excess from the characteristic. P = = -8. Compute the IBM Hexadecimal Floating Point Characteristic without the IBM HFP Excess. K = P = = = 45 4 = 4 4 Compute the IBM Hexadecimal Floating Point Characteristic with the IBM HFP Excess. N = K + 64 = = 9 = 3 6 = Write N into the IBM HFP High Order Characteristic. Append the implicit most significant bit to the left of the radix point for the IEEE DEP FP mantissa. Let MM = P MOD 4. This is the remainder obtained by dividing P by 4. MM = -8 MOD 4 = -.

35 Number Systems and Data Representation 35 Step 0: Step : Step 2: Step 3: Compute the number of places to shift the appended mantissa to obtain the IBM HFP mantissa. If MM = 0, then J = 4 If MM > 0, then J = 4 MM If MM < 0, then J = MM where the vertical bars identify the absolute value function. J = - = Beginning with the most significant bit of the shifted mantissa, copy the remaining bits from the IEEE Double Extended Precision Floating Point mantissa into the IBM Hexadecimal Floating Point Mantissa. Compute the IBM HFP Low Order Characteristic. Q = N 4 = 9 4 = 5. Write Q into the IBM HFP Low Order Characteristic. IBM Hexadecimal Extended Floating Point High Order Word S High Order Characteristic High Order Mantissa High Order Mantissa (Continued ) High Order Mantissa (Continued 2) High Order Mantissa (Continued 3) Low Order Word S Low Order Characteristic Low Order Mantissa Low Order Mantissa (Continued )

36 Number Systems and Data Representation 36 Low Order Mantissa (Continued 2) Low Order Mantissa (Continued 3) Bits 8 through are all default values of zero. Problem 6. IEEE Double Extended Precision Floating Point S Characteristic Mantissa Mantissa (Continuation ) Mantissa (Continuation 2) Mantissa (Continuation 3) Procedure: Step : Step 2: Step 3: Step 4: Set all IBM Hexadecimal Extended Floating Point bits to zero. Copy the IEEE Double Extended Precision Floating Point sign bit into the IBM Hexadecimal Extended Floating Point High Order sign bit and Low Order sign bit. Evaluate the IEEE Double Extended Precision Floating Point Excess from the characteristic. 3F0B 6 = (3 x 6 3 ) + ( F x 6 2 ) + ( 0 x 6 ) + (B x 6 0 ) = = 639. Subtract the IEEE Double Extended Precision Floating Point Excess from the characteristic. P = = -244.

37 Number Systems and Data Representation 37 Step 5: Step 6: Step 7: Step 8: Step 9: Step 0: Step : Step 2: Compute the IBM Hexadecimal Floating Point Characteristic without the IBM HFP Excess. K = P = = 60 4 = 4 4 Compute the IBM Hexadecimal Floating Point Characteristic with the IBM HFP Excess. N = K + 64 = = 4. Write N into the IBM HFP High Order Characteristic. Append the implicit most significant bit to the left of the radix point for the IEEE DEP FP mantissa. Let MM = P MOD 4. This is the remainder obtained by dividing P by 4. MM = -244 MOD 4 = 0. Compute the number of places to shift the appended mantissa to obtain the IBM HFP mantissa. If MM = 0, then J = 4 If MM > 0, then J = 4 MM If MM < 0, then J = MM where the vertical bars identify the absolute value function. J = 4 Beginning with the most significant bit of the shifted mantissa, copy the remaining bits from the IEEE Double Extended Precision Floating Point mantissa into the IBM Hexadecimal Floating Point High Order Mantissa. Compute the IBM HFP Low Order Characteristic. Q = N 4 = 4 4 = -0. We cannot proceed further because 0 is not a possible value for an IBM HFP Characteristic. Note that we can approximate the IEEE word by using an IBM Hexadecimal Long Floating Point word which does not need to use a low order characteristic.

38 Number Systems and Data Representation 38 IBM Hexadecimal Extended Floating Point High Order Word S High Order Characteristic High Order Mantissa High Order Mantissa (Continued ) High Order Mantissa (Continued 2) High Order Mantissa (Continued 3) Low Order Word S Low Order Characteristic Low Order Mantissa Low Order Mantissa (Continued ) Low Order Mantissa (Continued 2) Low Order Mantissa (Continued 3)

39 Number Systems and Data Representation 39 Problem 7. Convert the following IEEE Double Extended Precision Floating Point word to an IBM Hexadecimal Extended Floating Point word. IEEE Double Extended Precision Floating Point S Characteristic Mantissa Mantissa (Continuation ) Mantissa (Continuation 2) Mantissa (Continuation 3) Procedure: Step : Set all IBM Hexadecimal Extended Floating Point bits to zero. Step 2: Copy the IEEE Double Extended Precision Floating Point sign bit into the IBM Hexadecimal Extended Floating Point High Order sign bit and Low Order sign bit. Step 3: Evaluate the IEEE Double Extended Precision Floating Point Excess from the characteristic. 3B96 6 = (3 x 6 3 ) + ( B x 6 2 ) + ( 9 x 6 ) + (6 x 6 0 ) = = Step 4: Subtract the IEEE Double Extended Precision Floating Point Excess from the characteristic. P = = -29. Step 5: Compute the IBM Hexadecimal Floating Point Characteristic without the IBM HFP Excess. K = P = = = = 4 4 We cannot proceed further because 282 is not a possible value for an IBM HFP Characteristic.

40 Number Systems and Data Representation 40 IBM Hexadecimal Extended Floating Point High Order Word S High Order Characteristic High Order Mantissa High Order Mantissa (Continued ) High Order Mantissa (Continued 2) High Order Mantissa (Continued 3) Low Order Word S Low Order Characteristic Low Order Mantissa Low Order Mantissa (Continued ) Low Order Mantissa (Continued 2) Low Order Mantissa (Continued 3)

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

ECE 372 Microcontroller Design

ECE 372 Microcontroller Design Data Formats Humor There are 10 types of people in the world: Those who get binary and those who don t. 1 Information vs. Data Information An abstract description of facts, processes or perceptions How

More information

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

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

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

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

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

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

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

CHAPTER 2 NUMBER SYSTEMS

CHAPTER 2 NUMBER SYSTEMS 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,

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

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

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

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

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

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

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

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

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

Chapter 4 Number Representations

Chapter 4 Number Representations Chapter 4 Number Representations SKEE2263 Digital Systems Mun im/ismahani/izam {munim@utm.my,e-izam@utm.my,ismahani@fke.utm.my} February 9, 2016 Table of Contents 1 Fundamentals 2 Signed Numbers 3 Fixed-Point

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

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

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

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

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

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

Unit 3. Digital encoding

Unit 3. Digital encoding Unit 3. Digital encoding Digital Electronic Circuits (Circuitos Electrónicos Digitales) E.T.S.I. Informática Universidad de Sevilla 9/2012 Jorge Juan 2010, 2011, 2012 You are free to

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

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

Introduction CSE 541

Introduction CSE 541 Introduction CSE 541 1 Numerical methods Solving scientific/engineering problems using computers. Root finding, Chapter 3 Polynomial Interpolation, Chapter 4 Differentiation, Chapter 4 Integration, Chapters

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

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

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

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date. Schedule Date Day Class No. Dec Mon 25 Final Review 2 Dec Tue 3 Dec Wed 26 Final Review Title Chapters HW Due date Lab Due date LAB 8 Exam 4 Dec Thu 5 Dec Fri Recitation HW 6 Dec Sat 7 Dec Sun 8 Dec Mon

More information

Ex code

Ex code Ex. 8.4 7-4-2-1 code Codeconverter 7-4-2-1-code to BCD-code. When encoding the digits 0... 9 sometimes in the past a code having weights 7-4-2-1 instead of the binary code weights 8-4-2-1 was used. In

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

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

The Magic of Negative Numbers in Computers

The Magic of Negative Numbers in Computers IOSR Journal of Mathematics (IOSR-JM) e-issn: 2278-5728, p-issn: 2319-765X. Volume 12, Issue 4 Ver. I (Jul. - Aug.2016), PP 92-98 www.iosrjournals.org The Magic of Negative Numbers in Computers U. Sridevi

More information

CHAPTER 5 A BLOCK CIPHER INVOLVING A KEY APPLIED ON BOTH THE SIDES OF THE PLAINTEXT

CHAPTER 5 A BLOCK CIPHER INVOLVING A KEY APPLIED ON BOTH THE SIDES OF THE PLAINTEXT 82 CHAPTER 5 A BLOCK CIPHER INVOLVING A KEY APPLIED ON BOTH THE SIDES OF THE PLAINTEXT 83 5.1 Introduction In a pioneering paper, Hill [5] developed a block cipher by using the modular arithmetic inverse

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

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

Review for Test 1 : Ch1 5

Review for Test 1 : Ch1 5 Review for Test 1 : Ch1 5 October 5, 2006 Typeset by FoilTEX Positional Numbers 527.46 10 = (5 10 2 )+(2 10 1 )+(7 10 0 )+(4 10 1 )+(6 10 2 ) 527.46 8 = (5 8 2 ) + (2 8 1 ) + (7 8 0 ) + (4 8 1 ) + (6 8

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

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

Discrete mathematics is the study of techniques, ideas and modes of

Discrete mathematics is the study of techniques, ideas and modes of CHAPTER 1 Discrete Systems Discrete mathematics is the study of techniques, ideas and modes of reasoning that are indispensable in applied disciplines such as computer science or information technology.

More information

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering Boolean Algebra Boolean Algebra A Boolean algebra is defined with: A set of

More information

Please read carefully. Good luck & Go Gators!!!

Please read carefully. Good luck & Go Gators!!! Page 1/12 Exam 1 May the Schwartz be with you! Instructions: Turn off all cell phones and other noise making devices and put away all electronics Show all work on the front of the test papers Box each

More information

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by

More information

Chapter 5. Number Theory. 5.1 Base b representations

Chapter 5. Number Theory. 5.1 Base b representations Chapter 5 Number Theory The material in this chapter offers a small glimpse of why a lot of facts that you ve probably nown and used for a long time are true. It also offers some exposure to generalization,

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

CSE 1400 Applied Discrete Mathematics Definitions

CSE 1400 Applied Discrete Mathematics Definitions CSE 1400 Applied Discrete Mathematics Definitions Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Arithmetic 1 Alphabets, Strings, Languages, & Words 2 Number Systems 3 Machine

More information

Cs302 Quiz for MID TERM Exam Solved

Cs302 Quiz for MID TERM Exam Solved Question # 1 of 10 ( Start time: 01:30:33 PM ) Total Marks: 1 Caveman used a number system that has distinct shapes: 4 5 6 7 Question # 2 of 10 ( Start time: 01:31:25 PM ) Total Marks: 1 TTL based devices

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

SEVENTH EDITION and EXPANDED SEVENTH EDITION

SEVENTH EDITION and EXPANDED SEVENTH EDITION SEVENTH EDITION and EXPANDED SEVENTH EDITION Slide 5-1 Chapter 5 Number Theory and the Real Number System 5.1 Number Theory Number Theory The study of numbers and their properties. The numbers we use to

More information

1. Basics of Information

1. Basics of Information 1. Basics of Information 6.004x Computation Structures Part 1 Digital Circuits Copyright 2015 MIT EECS 6.004 Computation Structures L1: Basics of Information, Slide #1 What is Information? Information,

More information

Next, we include the several conversion from type to type.

Next, we include the several conversion from type to type. Number Conversions: Binary Decimal; Floating Points In order to communicate with a computer, we need, at some point, to speak the same language. The words of our language are made up of combinations of

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

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

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

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

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

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

17.1 Binary Codes Normal numbers we use are in base 10, which are called decimal numbers. Each digit can be 10 possible numbers: 0, 1, 2, 9.

17.1 Binary Codes Normal numbers we use are in base 10, which are called decimal numbers. Each digit can be 10 possible numbers: 0, 1, 2, 9. ( c ) E p s t e i n, C a r t e r, B o l l i n g e r, A u r i s p a C h a p t e r 17: I n f o r m a t i o n S c i e n c e P a g e 1 CHAPTER 17: Information Science 17.1 Binary Codes Normal numbers we use

More information

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5) CSE 54 Discrete Mathematics & Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices Integers & Algorithms (Section 2.5) by Kenneth H. Rosen, Discrete Mathematics & its Applications,

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

CS1800 Discrete Structures Fall 2017 October, CS1800 Discrete Structures Midterm Version A

CS1800 Discrete Structures Fall 2017 October, CS1800 Discrete Structures Midterm Version A CS1800 Discrete Structures Fall 2017 October, 2017 CS1800 Discrete Structures Midterm Version A Instructions: 1. The exam is closed book and closed notes. You may not use a calculator or any other electronic

More information

What is Binary? Digital Systems and Information Representation. An Example. Physical Representation. Boolean Algebra

What is Binary? Digital Systems and Information Representation. An Example. Physical Representation. Boolean Algebra What is Binary? Digital Systems and Information Representation CSE 102 Underlying base signals are two valued: 0 or 1 true or false (T or F) high or low (H or L) One bit is the smallest unambiguous unit

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

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

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function Question Paper Digital Electronics (EE-204-F) MDU Examination May 2015 1. (a) represent (32)10 in (i) BCD 8421 code (ii) Excess-3 code (iii) ASCII code (b) Design half adder using only NAND gates. ( c)

More information

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic Computer Arithmetic MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Fall 2013 Machine Numbers When performing arithmetic on a computer (laptop, desktop, mainframe, cell phone,

More information

Discrete Mathematics GCD, LCM, RSA Algorithm

Discrete Mathematics GCD, LCM, RSA Algorithm Discrete Mathematics GCD, LCM, RSA Algorithm Abdul Hameed http://informationtechnology.pk/pucit abdul.hameed@pucit.edu.pk Lecture 16 Greatest Common Divisor 2 Greatest common divisor The greatest common

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

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

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

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank University of Florida Dept. of Computer & Information Science & Engineering COT 3100 Applications of Discrete Structures Dr. Michael P. Frank Slides for a Course Based on the Text Discrete Mathematics

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

JNTU World. Digital Logic Design. Introduction

JNTU World. Digital Logic Design. Introduction Digital Logic Design Introduction A digital computer stores data in terms of digits (numbers) and proceeds in discrete steps from one state to the next. The states of a digital computer typically involve

More information

Residue Number Systems. Alternative number representations. TSTE 8 Digital Arithmetic Seminar 2. Residue Number Systems.

Residue Number Systems. Alternative number representations. TSTE 8 Digital Arithmetic Seminar 2. Residue Number Systems. TSTE8 Digital Arithmetic Seminar Oscar Gustafsson The idea is to use the residues of the numbers and perform operations on the residues Also called modular arithmetic since the residues are computed using

More information

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST JAMES MCIVOR Today we enter Chapter 2, which is the heart of this subject. Before starting, recall that last time we saw the integers have unique factorization

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

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

Chapter 1: Introduction and mathematical preliminaries

Chapter 1: Introduction and mathematical preliminaries Chapter 1: Introduction and mathematical preliminaries Evy Kersalé September 26, 2011 Motivation Most of the mathematical problems you have encountered so far can be solved analytically. However, in real-life,

More information

SUPPLEMENTARY INFORMATION

SUPPLEMENTARY INFORMATION SUPPLEMENTARY INFORMATION doi:10.1038/nature11875 Method for Encoding and Decoding Arbitrary Computer Files in DNA Fragments 1 Encoding 1.1: An arbitrary computer file is represented as a string S 0 of

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH There are 10 types of people in the world: those who understand binary and those who don't. Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Define the

More information

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS THE REAL NUMBER SYSTEM C O M P E T E N C Y 1 THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS This competency section reviews some of the fundamental

More information

Examples MAT-INF1100. Øyvind Ryan

Examples MAT-INF1100. Øyvind Ryan Examples MAT-INF00 Øyvind Ryan February 9, 20 Example 0.. Instead of converting 76 to base 8 let us convert it to base 6. We find that 76//6 = 2 with remainder. In the next step we find 2//6 = 4 with remainder.

More information

Recursive Definitions

Recursive Definitions Recursive Definitions Example: Give a recursive definition of a n. a R and n N. Basis: n = 0, a 0 = 1. Recursion: a n+1 = a a n. Example: Give a recursive definition of n i=0 a i. Let S n = n i=0 a i,

More information

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value EGC22 Digital Logic Fundamental Additional Practice Problems. Complete the following table of equivalent values. Binary. Octal 35.77 33.23.875 29.99 27 9 64 Hexadecimal B.3 D.FD B.4C 2. Calculate the following

More information

University of Florida EEL 3701 Summer 2015 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Tuesday, 30 June 2015

University of Florida EEL 3701 Summer 2015 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Tuesday, 30 June 2015 University of Florida EEL 3701 Summer 2015 Dr Eric M Schwartz Page 1/13 Exam 1 May the Schwartz be with you! Instructions: Turn off all cell phones and other noise making devices Show all work on the front

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

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

Computer Organization I Test 1/Version 1 CMSC 2833 Autumn 2007

Computer Organization I Test 1/Version 1 CMSC 2833 Autumn 2007 . Print your name on your scantron in the space labeled NAME. 2. Print CMSC 2833 in the space labeled SUBJECT. 3. Print the date, 9-20-2007, in the space labeled DATE. 4. Print your CRN, 2393, in the space

More information

4 Number Theory and Cryptography

4 Number Theory and Cryptography 4 Number Theory and Cryptography 4.1 Divisibility and Modular Arithmetic This section introduces the basics of number theory number theory is the part of mathematics involving integers and their properties.

More information

REVIEW Chapter 1 The Real Number System

REVIEW Chapter 1 The Real Number System REVIEW Chapter The Real Number System In class work: Complete all statements. Solve all exercises. (Section.4) A set is a collection of objects (elements). The Set of Natural Numbers N N = {,,, 4, 5, }

More information

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS: EKURHULENI TECH COLLEGE. No. 3 Mogale Square, Krugersdorp. Website: www. ekurhulenitech.co.za Email: info@ekurhulenitech.co.za TEL: 011 040 7343 CELL: 073 770 3028/060 715 4529 PAST EXAM PAPER & MEMO N3

More information

CIS102 Mathematics for Computing Volume 1

CIS102 Mathematics for Computing Volume 1 CIS102 Mathematics for Computing Volume 1 Update of 2nd Edition 2004 Carol Whitehead 3 December 2003 Contents Introduction iii 1 Numbers Systems 1 1.1 Number Bases.......................................

More information

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS The real number SySTeM C O M P E T E N C Y 1 THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS This competency section reviews some of the fundamental

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