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

Size: px
Start display at page:

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

Transcription

1 ECE-78: Digital Logic Design Fall 6 UNSIGNED INTEGER NUMBERS Notes - Unit 4 DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-by-digit representation of a positive integer number (powers of ): DIGIT Number: 937 hundreds thousands tens units thousands, 3 hundreds, 7 tens, and units = POSITIONAL NUMBER REPRESENTATION Let s consider the numbers from to 999. We represent these numbers with 3 digits (each digit being a number between and 9). We show a 3-digit number using the positional number representation: MATHEMATICAL REPRESENTATION 3-digit d d d EXAMPLE 9 Third Digit Second Digit First Digit The positional number representation allows us to express the decimal value using powers of ten: d + d + d. Example: Decimal Number Exercise: Write down the 3-digit and the powers of ten representations for the following numbers: Decimal Number 3-digit representation d + d + d digit representation d d d Third Digit Second Digit First Digit Powers of : d + d + d Instructor: Daniel Llamocca

2 ECE-78: Digital Logic Design Fall 6 General Case: Positional number representation for an integer positive number with n digits: Decimal Value: D = i=n d i i = d n n + d n n + + d + d i= Example: 9834 (7 digits) (6 digits) Maximum value: The table presents the maximum attainable value for a given number of digits. What pattern do you find? Can you complete it for the highlighted cases (4 and 6)? Number of digits Maximum value Range 9 = = = = d n- d n- d d n = n n - Maximum value for a number with n digits: Based on the table, the maximum decimal value for a number with n digits is given by: D = = 9 n- + 9 n = n - n digits With n digits, we can represent n positive integer numbers from to n -. With 7 digits, what is the range (starting from ) of positive numbers that we can represent? How many different numbers can we represent? BINARY NUMBER SYSTEM We are used to the decimal number system. However, there exist other number systems: octal, hexadecimal, vigesimal, binary, etc. In particular, binary numbers are very practical as they are used by digital computers. For binary numbers, the counterpart of the decimal digit (that can take values from to 9) is the binary digit, or bit (that can take the value of or ). DIGIT BIT Bit: Unit of information that a computer uses to process and retrieve data. It can also be used as a Boolean variable (see Unit ). Binary number: This is represented by a string of bits using the positional number representation: b n b n b b Converting a binary number into a decimal number: The following figure depicts two cases: -bit numbers and 3-bit numbers. Note that the positional representation with powers of two let us obtain the decimal value (integer positive) of the binary number. Instructor: Daniel Llamocca

3 ECE-78: Digital Logic Design Fall 6 MATHEMATICAL REPRESENTATION -bit Second Bit b b First Bit Binary number Powers of : Decimal Number b b b + b MATHEMATICAL REPRESENTATION 3-bit b b b Third Bit Second Bit First Bit Binary number General case: Positional number representation for a binary number with n bits: Powers of : Decimal Number b b b b + b + b Most significant (leftmost) bit b n- b n- b b Least significant (rightmost) bit The binary number can be converted to a positive decimal number by using the following formula: D = i=n b i i = b n n + b n n + + b + b i= To avoid confusion, we usually write a binary number and attach a suffix : (b n b n b b ) Example: 6 bits: () D = = 43 4 bits: () D = = Maximum value for a given number of bits. Complete the tables for the highlighted cases (4 and 6): Number of bits Maximum value Range n n - n - Maximum value for n bits: The maximum binary number is given by an n-bit string of s:. Then, the maximum decimal numbers is given by: D = = n- + n = n - n bits With n bits, we can represent n positive integer numbers from to n -. 3 Instructor: Daniel Llamocca

4 ECE-78: Digital Logic Design Fall 6 The case n=8 bits is of particular interest, as a string of 8 bits is called a byte. For 8-bit numbers, we have 56 numbers in the range to 8 - to 55. Most significant (leftmost) bit b 7 b 6 b 5 b 4 b 3 b b b Least significant (rightmost) bit The table shows some examples: Decimal Number 8-bit format b 7 b 6 b 5 b 4 b 3 b d d b b b b b b + b + b Exercise: Convert the following binary numbers (positive integers) to their decimal values: 8-bit representation b b b b b b + b + b Decimal Number CONVERSION OF A NUMBER IN ANY BASE TO THE DECIMAL SYSTEM To convert a number of base 'r' (r =, 3,4, ) to decimal, we use the following formula: base 'r': (r n r n r r ) r Conversion to decimal: D = i=n r i r i = r n r n + r n r n + + r r + r r i= Also, the maximum decimal value for a number in base 'r' with 'n' digits is: D = rrr rrr = r r n + r n r n + + r r + r r = r n Example: Base-8: Number of digits Maximum value Range n n n - Examples: (563) 8 : base 8 (octal system) Number of digits: n = 5 Conversion to decimal: D = = 89 (3) 4 : base 4 (quaternary system) Number of digits: n = 4 Conversion to decimal: D = = 4 Instructor: Daniel Llamocca

5 ECE-78: Digital Logic Design Fall 6 CONVERSION OF DECIMAL (INTEGER POSITIVE) TO BINARY NUMBERS Examples: base base base base 5???? 3???? 6 5 Remainder 6 3 Remainder stop here! stop here! Note that some numbers require fewer bits than others. If we want to use a specific bit representation, e.g., 8-bit, we just need to append zeros to the left until the 8 bits are completed. For example: (8-bit number) (8-bit number) Actually, you can use this method to convert a decimal number into any other base. For example, if you want to convert it into a base-8 number, just divide by 8 and group the remainders. Example: Converting a decimal number to base-8: base Remainder 3 base 8???? stop here! 5 Instructor: Daniel Llamocca

6 ECE-78: Digital Logic Design Fall 6 Exercise: Convert the following two decimal numbers to binary numbers. Fill in the blanks in the figure below. base base base base 63???? 97???? Remainder Remainder Now, convert the following decimal numbers to binary numbers. The final binary number must have 8 bits (append zeros to the left to complete). Decimal number 4 Binary number with 8 bits b 7b 6b 5b 4b 3b b b Instructor: Daniel Llamocca

10 ECE-78: Digital Logic Design Fall 6 Exercise: Convert these hexadecimal numbers to binary. Verify it by converting both the binary and hexadecimal number (they should match). Hexadecimal number A A CE Binary number Decimal value The reason hexadecimal numbers are popular is because hexadecimal numbers provide a short-hand notation for binary numbers. OCTAL NUMBERS An octal digit can takes between and 7. This is another common number system in computers is base-8 (octal). The conversion between base-8 and base- resembles that of converting between base-6 and base-. Here, we group binary numbers in 3-bit groups: BINARY TO OCTAL Binary: octal: 3 5 Then: = 35 8 binary dec oct Verification: = = = = 93 OCTAL TO BINARY = 3 8 = DO NOT discard these zeros when concatening! Instructor: Daniel Llamocca

14 b 8 = b 7 = b 6 = b 5 = b 4 = b 3 = b = b = b = b = b = b = b 8 = b 7 = b 6 = b 5 = b 4 = b 3 = b = b = b = c = c = c = ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-78: Digital Logic Design Fall 6 ARITHMETIC OVERFLOW: Suppose we have only 4 bits to represent binary numbers: cout= + cout= OVERFLOW!!! + Overflow occurs when an arithmetic operation require more bits than the bits we are using to represent our numbers. For 4 bits, the range is to 5. If the summation is greater than 5, then there is overflow. For n bits, overflow occurs when the sum is greater than n. Also, for unsigned numbers: overflow bit = c out. x n- y n- x y x y x y c n c n- c 3 c c c c in overflow=c out s n- To avoid overflow in addition operation, a common technique is to sign-extend the two summands. For example, if the two summands are 4-bits wide, then we add one more bit. So, we use 5 bits to represent our numbers. In the case of unsigned numbers, sign-extend amounts to zero-extend. In general, if the two summands are n-bits wide, the result will have at most n + bits. UNSIGNED NUMBERS - SUBTRACTION s s s cout= + In the example, we subtract two 8-bit numbers using the binary and hexadecimal (this is a short-hand notation) representations. A subtraction of two digits (binary or hexadecimal) generates a borrow when the difference is negative. So, we borrow from the next digit so that the difference is positive. Recall that a borrow in a subtraction of two digits is an extra that we need to subtract. Also, note that b is the borrow in of the summation. This is usually zero. The last borrow (b 8 when n=8) is the borrow out of the subtraction. If it is zero, it means that the difference is positive and can be represented with 8 bits. If it is one, it means that the difference is negative and we need to borrow from the next digit. In the example, we subtract two 8-bit numbers, the result we have borrows from the next digit. x3a = - xf = xb = x3a = - x75 = 3 A - F B 3 A xc5 = C 5 We can build an n-bit subtractor for unsigned numbers using Full Subtractor circuits. In practice, subtraction is better performed in the s complement representation (for signed numbers). x n- y n- x y x y x y b out b in x n- x n- x x - y n- y n- y y b out b n b n- FS b 3 FS b FS b FS b b in d n- d n- d d Full Subtractor Design x i y i b i b i+ d i d n- d d d x i y i b i d i = x i y i b i + x i y i b i + x i y i b i + x i y i b i d i = (x i y i )b i + (x i y i )b i d i = x i y i b i x i y i b i b i+ = x i y i + x i b i + y i b i 4 Instructor: Daniel Llamocca

15 ECE-78: Digital Logic Design Fall 6 SIGNED INTEGER NUMBERS For an n-bit number b n b n b b, there exist three common signed representations: sign-and-magnitude, s complement, and s complement. In these three representations, the MSB always tells us whether the number is positive (MSB=) or negative (MSB=). These representations allow us to represent both positive and negative numbers. SIGN-AND-MAGNITUDE (SM): Here, the sign and the magnitude (value) are represented separately. The MSB only represents the sign and the remaining n bits the magnitude. Example (n=4): = +6 = -6 'S COMPLEMENT (C): Here, if the MSB=, the number is positive and the remaining n bits represent the magnitude. If the MSB=, the number is negative and the remaining n bits do not represent the magnitude. To invert the sign of a number in s complement representation, we apply the s complement operation to the number, which consists of inverting all the bits. Let B = b n b b be a number represented in s complement. Let K = k n k k represent B. We get K by applying the s complement operation to B. K is also called the s complement of B (and viceversa). Definition: The s complement of B is defined as K = ( n ) B, n = # of bits (including sign bit), where K = n i= k i i and B = n i= b i i. Note that K and B are treated as unsigned numbers in this formula. And ( n ) is the largest n-bit unsigned number. We can then show that the s complement operation amounts to inverting all the bits: n k i i = ( n ) b i i (k i + b i ) i i= n i= n i= = n k i + b i =, i k i = b i Example: Given B = = 9 in s complement, get the s complement representation of -9 using the formula: K = ( n ) B = ( 5 ) 9 = =. Recall that the formula treats K and B as unsigned integers. So, K = in unsigned representation, and K = 9 in s complement representation. It is much simpler to just invert each bit! With n bits, we can represent n numbers from n + to n. When using the 's complement representation, it is mandatory to specify how many bits we are using. Examples: +6= -6=, +5= -5=, +7= -7=. If -6=, we get +6 by applying the s complement operation to +6 = Get the s complement representation of 8: This is a positive number, thus the MSB=. The remaining n bits represent the magnitude. The magnitude is represented with a minimum number of 4 bits as 8=. Thus, using a minimum number of 5 bits, the number 8 in s complement representation is 8=. What is the decimal value of? We first apply the s complement operation to, which results in (+3). Thus =-3. What is the s complement representation of -4? We know that +4=. To get -4, we apply the s complement operation to, which results in. Thus =-4. 'S COMPLEMENT (C): Here, if the MSB=, the remaining n bits represent the magnitude. If the MSB=, the number is negative and the remaining n bits do not represent the magnitude. To invert the sign of a number in s complement representation, we apply the s complement operation to the number, which consists on inverting all the bits and add. Let B = b n b b be a number represented in s complement. Let K = k n k k represent B. We get K by applying the s complement operation to B. K is also called the s complement of B (and viceversa). Definition: The s complement of B is defined as K = ( n ) B +, n = # of bits (including sign bit), where K = n i= k i i and B = n i= b i i. Note that K and B are treated as unsigned numbers in this formula. We can see that we can first get the term ( n ) B by inverting all the bits; then we add to complete the equation. Example: Given = = 9 in s complement, get the s complement representation of -9 using the formula: K = ( n ) B + = ( 5 ) 9 + = 3 =. Recall that the formula treats K and B as unsigned integers. So, K = 3 in unsigned representation, and K = 9 in s complement representation. It is much simpler to just invert each bit (i.e., apply s complement operation) and then add! With n bits, we can represent n numbers from n to n. When using the 's complement representation, it is mandatory to specify how many bits we are using. 5 Instructor: Daniel Llamocca

16 ECE-78: Digital Logic Design Fall 6 Examples: +6= -6=, +5= -5=, +7= -7=. If -6=, we get +6 by applying the s complement operation to +6 = Represent in s complement: This is a positive number, MSB=. The remaining n bits represent the magnitude. We can get the magnitude with a minimum 4 bits: =. Thus, using a minimum of 5 bits, the number in s complement representation is =. What is the decimal value of? We first apply the s complement operation (or take the s complement) to, which results in (+3). Thus =-3. What is the s complement representation of -4? We know that +4=. To get -4, we apply the s complement operation to, which results in. Thus =-4. Getting the decimal value of a number in 's complement representation: If the number B is positive, then MSB=: b n =. n i= n i= n B = b i i = b n n + b i i = b i i (a) If the number B is negative, b n = (MSB=). If we take the s complement of B, we get K (which is a positive number). In s complement representation, K represents B. Using K = n B (K and B are treated as unsigned numbers): n k i i = n b i i We want a to express K in terms of b i, since the integer value K is the actual integer value of B. n i= K = k i i = b i i n = b n n + b i i n = n (b n ) + b i i i= n i= n n i= n B = K = n ( ) + b i i = n + b i i (b) Using (a) and (b), the formula for the decimal value of B (either positive or negative) is: i= n i= B = b n n + b i i Examples: = = = = 8 SUMMARY The following table summarizes the signed representations for a 4-bit number: n=4: SIGNED REPRESENTATION b 3b b b Sign-and-magnitude s complement s complement Range for n bits: [ ( n ), n ] [ ( n ), n ] [ n, n ] C and C are representations of signed numbers. C and C represent both negative and positive numbers. Do not confuse the C and C representations with the C and C operations. Note that the sign-and-magnitude and the s complement representations have a redundant representation for zero. This is not the case in s complement, which can represent an extra number. In C, the number -8 can be represented with 4 bits: -8=. To obtain +8, we apply the C operation to, which results in. But cannot be a positive number. This means that we require 5 bits to represent +8=. i= i= n i= n i= 6 Instructor: Daniel Llamocca

17 ECE-78: Digital Logic Design Fall 6 SIGN EXTENSION UNSIGNED NUMBERS: Here, if we want to use more bits, we just append zeros to the left. Example: = with 4 bits. If we want to use 6 bits, then =. SIGNED NUMBERS: Sign-and-magnitude: The MSB only represents the sign. If we want to use more bits, we append zeros to the left. The leftmost bit is always the sign. Example: - = with 5 bits. If we want to use 7 bits, then - =. s complement (also applies to s complement): In many circumstances, we might want to represent numbers in 's complement with a fixed number of bits. For example, the following two numbers require a minimum of 5 bits: = = 9 = = +5 What if we wanted to use 8 bits to represent them? In s complement, we need to sign-extend: If the number is positive, we append zeros to the left. If the number is negative, we attach ones to the left. In the example, note how we added three bits to the left in each case: = = 9 = = +5 Demonstration of sign-extension in s complement: To increase the number of bits for representing a number, we append the MSB to the left as many times as needed: b n b n b b n b n b n b n b Examples: = = + = 5 = = = = We can think of the sign-extended number as an m-bit number, where m > n: b n b n b n b n b = b m b n b n b n b, where: b i = b n, i = n, n +,, m We need to demonstrate that b n b n b represents the same decimal number as b n b n b n b n b, i.e., that the sign-extension is correct for any m > n. We need that: b m b n b n b n b = b n b n b n b n b = b n b n b Using the formula for 's complement numbers: m m b m + i b i = n b n + i b i i= m i=n m n i= n i= m b m + i b i + i b i = n b n + i b i m b m + i b i = n b n m b n + b n Recall: r i l i=k i = n b n, i=n = rk r l+ r, r i l i=k n i= = k l+ = l+ k m i=n Then: m b n + b n ( m n ) = n b n m b n + m b n n b n = n b n n b n = n b n SIGNED NUMBERS ADDITION AND SUBTRACTION We will use the s complement representation for signed numbers. The advantage of the s complement representation is that the summation can be carried out using the same circuitry as that of the unsigned summation. Here the operands can either be positive or negative. We show addition examples of 4-bit signed numbers. Note that the carry out bit does not necessarily indicate overflow. In some cases, the carry out must be ignored, otherwise the result is incorrect. +5 = + + = -5 = + + = +5 = + - = -5 = + - = +7 = -3 = +3 = -7 = cout= cout= cout= cout= 7 Instructor: Daniel Llamocca

18 c 5 = c 4 = c 3 = c = c = c = c 5 = c 4 = c 3 = c = c = c = c 4 = c 3 = c = c = c = c 8 = c 7 = c 6 = c 5 = c 4 = c 3 = c = c = c = c 8 = c 7 = c 6 = c 5 = c 4 = c 3 = c = c = c = c 8 = c 7 = c 6 = c 5 = c 4 = c 3 = c = c = c = c 8 = c 7 = c 6 = c 5 = c 4 = c 3 = c = c = c = ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-78: Digital Logic Design Fall 6 Now, we show addition examples of two 8-bit signed numbers. The carry out c 8 is not enough to determine overflow. Here, if c 8 c 7 there is overflow. If c 8=c 7, no overflow and we can ignore c 8. Thus, the overflow bit is equal to c 8 XOR c 7. Note that overflow happens when the summation falls outside the s complement range for 8 bits: [ 7, 7 ]. +9 = = +7 = overflow = c 8 c 7 = -> overflow! +7 [- 7, 7 -] -> overflow! -9 = = -7 = overflow = c 8 c 7 = -> overflow! -7 [- 7, 7 -] -> overflow! +9 = = +4 = overflow = c 8 c 7 = -> no overflow +4 [- 7, 7 -] -> no overflow -9 = = -4 = overflow = c 8 c 7 = -> no overflow -4 [- 7, 7 -] -> no overflow In general, for an n-bit number, overflow occurs when the summation falls outside the range [ n, n ]. The overflow bit can quickly be computed as overflow = c n c n. Also, c out = c n. DIGITAL CIRCUIT The figure depicts a n-bit adder for s complement numbers: x n- y n- x y x y x y overflow c out c n c n- c 3 c c c c in s n- Subtraction: Note that A B = A + C(B). To subtract two numbers represented in s complement arithmetic, we first apply the s complement operation to B (the subtrahend), and then add the numbers. So, in s complement arithmetic, subtraction is actually an addition of two numbers. The digital circuit for s complement subtraction is based on the adder. We account for the s complement operation for the subtrahend by inverting every bit in the subtrahend and by making the c in bit equal to. x n- y n- s x y s x y s 7-3 = 7 + (-3): +3= -3= cout = overflow = x y +7 = + -3 = +4 = overflow c out c n c n- c 3 c c c c in = s n- To avoid overflow when adding/subtracting, a common technique is to sign-extend the two summands. For example, for two 4-bits summands, we add an extra bit; so, we use 5 bits to represent our numbers. In general, if the two summands are n-bits wide, the result will have at most n + bits. Recall that if there is no overflow in a summation result, the carry out bit must not be part of the result. s s +7 = + + = +9 = s -7 = + - = -9 = 8 Instructor: Daniel Llamocca

19 ECE-78: Digital Logic Design Fall 6 Adder/Subtractor Unit for 's complement numbers: We can combine the adder and subtractor in a single circuit if we are willing to give up the input c in. x n- y n- x y x y x y add/sub add = sub = overflow c out c n c n- c 3 c c c s n- s s s add/sub y i f add/sub y i f 9 Instructor: Daniel Llamocca

20 ECE-78: Digital Logic Design Fall 6 MULTIPLICATION OF INTEGER NUMBERS ARRAY MULTIPLIER FOR UNSIGNED NUMBERS A straightforward implementation of the multiplication operation is depicted in the figure: at every diagonal of the circuit, we add up all terms in a column of the multiplication. The figure shows the process and circuit for multiplying two unsigned numbers of 4 bits. x cin y a 3 a a a x b 3 b b b FULL ADDER cout s a 3 b a b a b a b a 3 b a b a b a b a 3 b a b a b a b a 3 b 3 a b 3 a b 3 a b 3 p 7 p 6 p 5 p 4 p 3 p p p b(3) b() b() b() a() a b 3 a b a b a b m 3 m m m s 3 s s s a() c c c a b 3 a b a b a b m 3 m m m p() s 3 s s c c c s a() a b 3 a b a b a b m 3 m m m p() s 3 s s c c c s a(3) a 3 b 3 a 3 b a 3 b a 3 b m 33 m 3 m 3 m 3 p() s 33 s 3 s 3 c 3 c 3 c 3 s 3 m 43 m 4 m 4 m 4 p(3) p(7) p(6) p(5) p(4) Instructor: Daniel Llamocca

21 ECE-78: Digital Logic Design Fall 6 MULTIPLICATION OF SIGNED NUMBERS A straightforward implementation consists of checking the sign of the multiplicand and multiplier. If one or both are negative, we change the sign by applying the s complement operation. This way, we are left with unsigned multiplication. As for the final output: if only one of the inputs was negative, then we modify the sign of the output. Otherwise, the result of the unsigned multiplication is the final output. x x x x x x x Note: If one of the inputs is n, then the s complement of it is n, which requires n + bits. Here, we are allowed to use only n bits; in other words, we do not have to change its sign. This will not affect the final result since if we were to use n + bits for n, the MSB=, which implies that the last row is full of zeros. x x x x x x Final output: It requires n bits. Note that it is only because of the multiplication of n by n that we require those n bits (in s complement representation) Instructor: Daniel Llamocca

22 ECE-78: Digital Logic Design Fall 6 BINARY CODES We know that with n bits, we can represent n numbers, from to n. This is a commonly used range. However, with n bits, we can also represent n numbers in any range. Moreover, with n bits we can represent n different symbols. For example, in 4-bit color, each color is represented by 4 bits, providing 4 distinct colors. Each color is said to have a binary code. N = 5 symbols. With bits, only 4 symbols can be represented. With 3 bits, 8 symbols can be represented. Thus, the number of bits required is n = 3 = log 5 = log 8. Note that 8 is the power of closest to N=5 that is greater than or equal to 5. In general, if we have N symbols to represent, the number of bits required is given by log N. For example: Minimum number of bits to represent 7, colors: Number of bits: log 7 = 7 bits. Minimum number of bits to represent numbers between 5, and 9,96: There are 9,96-5,+=497. Then, number of bits: log 497 = 3 bits. 7-bit US-ASCII character-encoding scheme: Each character is represented by 7 bits. Thus, the number of characters that can be represented is given by 7 = 8. Each character is said to have a binary code. Unicode: This code can represent more than, characters and attempts to cover all world s scripts. A common character encoding is UTF-6, which uses pair of 6-bit units: For most purposes, a 6 bit unit suffices ( 6 = characters): (Greek theta symbol) = 3D (Greek capital letter Omega): 3A9 Ж (Cyrillic capital letter zhe): 46 Instructor: Daniel Llamocca

23 ECE-78: Digital Logic Design Fall 6 BCD Code: In this coding scheme, decimal numbers are represented in binary form by independently encoding each decimal digit in binary form. Each digit requires 4 bits. Note that only values from are 9 are represented here. This is a very useful code for input devices (e.g.: keypad). But it is not a coding scheme suitable for arithmetic operations. Also, notice that the binary numbers () to (5) are not used. Only out of 6 values are used to encode each decimal digit. Examples: Decimal number 47: This decimal number can be represented as a binary number:. In BCD format, this would be: Decimal number 58: This decimal number can be represented as a binary number:. In BCD format, the binary representation would be: The BCD code is not the same as the binary number! BCD decimal # There exist many other binary codes (e.g., reflective gray code, code, -out-of-5 code) to represent decimal numbers. Usually, each of them is tailored to an specific application. REFLECTIVE GRAY CODE: Decimal g g Number b b b g g g g 3 g g g b n- b n- b b g n- g n- g g g n- g n- g g b n- b n- b b Application: Measuring angular position with 4-bit RGC. 4 beams are emitted along an axis. When a light beam passes (transparent spots, represented as whites), we get a logical, otherwise. The RGC encoding makes that between areas only one bit changes, thereby reducing the possibility of an incorrect reading (especially when the beam between adjacent areas). For example: from to only one bit flips. If we used to, two bits would flip: that would be prone to more errors, especially when the beams are close to the line where the two areas meet EMITTER RECEPTOR g g g g 3 Angle g 3 g g g 3 Instructor: Daniel Llamocca

24 ECE-78: Digital Logic Design Fall 6 INTRODUCTION TO FIXED-POINT ARITHMETIC We have been representing positive integer numbers. But what if we wanted to represent numbers with fractional parts? Fixed-point arithmetic: Binary representation of positive decimal numbers with fractional parts. Given the following binary number: Formula to convert it to decimal: n (b n b n b b. b b b k ) D = b i i = b n n + b n n + + b + b + b + b + b k k i= k Conversion from binary to hexadecimal (or octal): (unsigned numbers) Binary:.. octal: 5. 6 Binary:.. Example: (unsigned number). = =.65 Example: Now, what if we have a decimal number with fractional part? What we do is we divide the integer part and the fractional part. We obtain the binary representation of the integer part using what we know. As for the fractional part, what we do is successive multiplications by, the resulting integer parts resulting is the result. base.65 MSB.65x =.5 = +.5 hexadecimal: base???? 5 base.7. A 8 MSB.7x =.4 = +.4 base????.5x =.5 = +.5.5x = = +.4x =.8 = +.8.8x =.6 = +.6. stop here!.6x =. = +..x =.4 = +.4.4x =.8 = +.8. Example (signed number): Convert to the s complement representation. First, we get the binary representation of , and then apply the s complement operation to that result. 379 =. In s complement: 379 =,.875 =.. Then: =.. This is the s complement representation of Finally, we get by getting the s complement of the previous result: =. = xe84.c8 (to convert to hexadecimal, we append zeros to the LSB and sign-extend the MSB) 4 Instructor: Daniel Llamocca

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

UNSIGNED INTEGER NUMBERS Notes - Unit 4 DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-by-digit representation of a positive integer number (powers of ): DIGIT 3 4 5 6 7 8 9 Number:

### DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING, THE UNIVERSITY OF NEW MEXICO ECE-238L: Computer Logic Design Fall 2013.

ECE-8L: Computer Logic Design Fall Notes - Chapter BINARY NUMBER CONVERSIONS DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-b-digit representation of a positive integer number (powers

### Solutions - Homework 2 (Due date: October 4 5:30 pm) Presentation and clarity are very important! Show your procedure!

Solutions - Homework 2 (Due date: October 4 th @ 5:30 pm) Presentation and clarity are very important! Show your procedure! PROBLEM 1 (28 PTS) a) What is the minimum number of bits required to represent:

### Number System. Introduction. Decimal Numbers

Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26

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

CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System

### Digital Fundamentals

Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Decimal Numbers The position of each digit in a weighted

### CHW 261: Logic Design

CHW 261: Logic Design Instructors: Prof. Hala Zayed Dr. Ahmed Shalaby http://www.bu.edu.eg/staff/halazayed14 http://bu.edu.eg/staff/ahmedshalaby14# Slide 1 Slide 2 Slide 3 Digital Fundamentals CHAPTER

### Chapter 2: Number Systems

Chapter 2: Number Systems Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This two-valued number system is called binary. As presented earlier, there are many

### DIGITAL SYSTEM DESIGN

DIGITAL SYSTEM DESIGN UNIT I: Introduction to Number Systems and Boolean Algebra Digital and Analog Basic Concepts, Some history of Digital Systems-Introduction to number systems, Binary numbers, Number

### Solutions - Homework 2 (Due date: February 5 5:30 pm) Presentation and clarity are very important! Show your procedure!

Solutions - Homework (Due date: Februar 5 th @ 5: pm) Presentation and clarit are ver important! Show our procedure! PROBLEM ( PTS) In these problems, ou MUST show our conversion procedure. a) Convert

Binary Addition The rules for binary addition are 0 + 0 = 0 Sum = 0, carry = 0 0 + 1 = 0 Sum = 1, carry = 0 1 + 0 = 0 Sum = 1, carry = 0 1 + 1 = 10 Sum = 0, carry = 1 When an input carry = 1 due to a previous

### EE292: Fundamentals of ECE

EE292: Fundamentals of ECE Fall 2012 TTh 10:00-11:15 SEB 1242 Lecture 22 121115 http://www.ee.unlv.edu/~b1morris/ee292/ 2 Outline Review Binary Number Representation Binary Arithmetic Combinatorial Logic

### Microcomputers. Outline. Number Systems and Digital Logic Review

Microcomputers Number Systems and Digital Logic Review Lecture 1-1 Outline Number systems and formats Common number systems Base Conversion Integer representation Signed integer representation Binary coded

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

COURSE / CODE DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) NUMBER SYSTEM A considerable subset of digital systems deals with arithmetic operations. To understand the

### Chapter 2 Number System

Chapter 2 Number System Embedded Systems with ARM Cortext-M Updated: Tuesday, January 16, 2018 What you should know.. Before coming to this class Decimal Binary Octal Hex 0 0000 00 0x0 1 0001 01 0x1 2

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

UNIT I Digital Systems: Binary Numbers, Octal, Hexa Decimal and other base numbers, Number base conversions, complements, signed binary numbers, Floating point number representation, binary codes, error

### Number representations

Number representations Number bases Three number bases are of interest: Binary, Octal and Hexadecimal. We look briefly at conversions among them and between each of them and decimal. Binary Base-two, or

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

Slide Set 1 for ENEL 339 Fall 2014 Lecture Section 02 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Fall Term, 2014 ENEL 353 F14 Section

### Lecture 2: Number Systems

Lecture 2: Number Systems Syed M. Mahmud, Ph.D ECE Department Wayne State University Original Source: Prof. Russell Tessier of University of Massachusetts Aby George of Wayne State University Contents

### Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Decimal & Binary Representation Systems Decimal & binary are positional representation systems each position has a value: d*base i for example: 321 10 = 3*10 2 + 2*10 1 + 1*10 0 for example: 101000001

### Number Systems Base r

King Fahd University of Petroleum & Minerals Computer Engineering Dept COE 2 Fundamentals of Computer Engineering Term 22 Dr. Ashraf S. Hasan Mahmoud Rm 22-44 Ext. 724 Email: ashraf@ccse.kfupm.edu.sa 3/7/23

### Chapter 1 Review of Number Systems

1.1 Introduction Chapter 1 Review of Number Systems Before the inception of digital computers, the only number system that was in common use is the decimal number system which has a total of 10 digits

### Number Systems CHAPTER Positional Number Systems

CHAPTER 2 Number Systems Inside computers, information is encoded as patterns of bits because it is easy to construct electronic circuits that exhibit the two alternative states, 0 and 1. The meaning of

### Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

Chapter 3: Number Systems and Codes Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc., 5 th edition Decimal System The radix or base of a number system determines

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

D I G I T A L C I R C U I T S E E Digital Circuits Basic Scope and Introduction This book covers theory solved examples and previous year gate question for following topics: Number system, Boolean algebra,

### DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

C H A P T E R 6 DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS OUTLINE 6- Binary Addition 6-2 Representing Signed Numbers 6-3 Addition in the 2 s- Complement System 6-4 Subtraction in the 2 s- Complement

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

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm Nathan Pihlstrom www.uccs.edu/~npihlstr My Background B.S.E.E. from Colorado State University M.S.E.E. from Colorado State University M.B.A. from UCCS Ford

### Chapter 2. Data Representation in Computer Systems

Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting

### Data Representation 1

1 Data Representation Outline Binary Numbers Adding Binary Numbers Negative Integers Other Operations with Binary Numbers Floating Point Numbers Character Representation Image Representation Sound Representation

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

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

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

Digital Fundamentals CHAPTER 2 Number Systems, Operations, and Codes Decimal Numbers The decimal number system has ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 The decimal numbering system has a base of

### CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:

### CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:

### ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Problem 1 (4 parts, 21 points) Encoders and Pass Gates Part A (8 points) Suppose the circuit below has the following input priority: I 1 > I 3 > I 0 > I 2. Complete the truth table by filling in the input

### M1 Computers and Data

M1 Computers and Data Module Outline Architecture vs. Organization. Computer system and its submodules. Concept of frequency. Processor performance equation. Representation of information characters, signed

### Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Slide Set 1 for ENEL 353 Fall 2017 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Fall Term, 2017 SN s ENEL 353 Fall 2017 Slide Set 1 slide

### Binary Codes. Dr. Mudathir A. Fagiri

Binary Codes Dr. Mudathir A. Fagiri Binary System The following are some of the technical terms used in binary system: Bit: It is the smallest unit of information used in a computer system. It can either

### Computer Organization

Computer Organization Register Transfer Logic Number System Department of Computer Science Missouri University of Science & Technology hurson@mst.edu 1 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5,

### Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations How do we represent data in a computer? At the lowest level, a computer is an electronic machine. works by controlling the flow of electrons Easy to recognize

### EE 109 Unit 6 Binary Arithmetic

EE 109 Unit 6 Binary Arithmetic 1 2 Semester Transition Point At this point we are going to start to transition in our class to look more at the hardware organization and the low-level software that is

### Chapter 2 Bits, Data Types, and Operations

Chapter Bits, Data Types, and Operations How do we represent data in a computer? At the lowest level, a computer is an electronic machine. works by controlling the flow of electrons Easy to recognize two

### Numbering systems. Dr Abu Arqoub

Numbering systems The decimal numbering system is widely used, because the people Accustomed (معتاد) to use the hand fingers in their counting. But with the development of the computer science another

### Module 2: Computer Arithmetic

Module 2: Computer Arithmetic 1 B O O K : C O M P U T E R O R G A N I Z A T I O N A N D D E S I G N, 3 E D, D A V I D L. P A T T E R S O N A N D J O H N L. H A N N E S S Y, M O R G A N K A U F M A N N

### 10.1. Unit 10. Signed Representation Systems Binary Arithmetic

0. Unit 0 Signed Representation Systems Binary Arithmetic 0.2 BINARY REPRESENTATION SYSTEMS REVIEW 0.3 Interpreting Binary Strings Given a string of s and 0 s, you need to know the representation system

### Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2 Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Website is up

### CS & IT Conversions. Magnitude 10,000 1,

CS & IT Conversions There are several number systems that you will use when working with computers. These include decimal, binary, octal, and hexadecimal. Knowing how to convert between these number systems

### CO Computer Architecture and Programming Languages CAPL. Lecture 9

CO20-320241 Computer Architecture and Programming Languages CAPL Lecture 9 Dr. Kinga Lipskoch Fall 2017 A Four-bit Number Circle CAPL Fall 2017 2 / 38 Functional Parts of an ALU CAPL Fall 2017 3 / 38 Addition

### MACHINE LEVEL REPRESENTATION OF DATA

MACHINE LEVEL REPRESENTATION OF DATA CHAPTER 2 1 Objectives Understand how integers and fractional numbers are represented in binary Explore the relationship between decimal number system and number systems

### 1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

CS 64 Lecture 2 Data Representation Reading: FLD 1.2-1.4 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 ) + (1x10 0 ) 1010 10?= 1010 2?= 1

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

Data Representation II CMSC 313 Sections 01, 02 The conversions we have so far presented have involved only unsigned numbers. To represent signed integers, computer systems allocate the high-order bit

### Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Data Representation COE 30 Computer Organization Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals Presentation Outline Positional Number

### Inf2C - Computer Systems Lecture 2 Data Representation

Inf2C - Computer Systems Lecture 2 Data Representation Boris Grot School of Informatics University of Edinburgh Last lecture Moore s law Types of computer systems Computer components Computer system stack

### Digital Fundamentals

Digital Fundamentals Tenth Edition Floyd Chapter 1 Modified by Yuttapong Jiraraksopakun Floyd, Digital Fundamentals, 10 th 2008 Pearson Education ENE, KMUTT ed 2009 Analog Quantities Most natural quantities

### Chapter 10 Binary Arithmetics

27..27 Chapter Binary Arithmetics Dr.-Ing. Stefan Werner Table of content Chapter : Switching Algebra Chapter 2: Logical Levels, Timing & Delays Chapter 3: Karnaugh-Veitch-Maps Chapter 4: Combinational

### CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

CHAPTER V-1 CHAPTER V CHAPTER V NUMBER SYSTEMS AND ARITHMETIC CHAPTER V-2 NUMBER SYSTEMS RADIX-R REPRESENTATION Decimal number expansion 73625 10 = ( 7 10 4 ) + ( 3 10 3 ) + ( 6 10 2 ) + ( 2 10 1 ) +(

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

Contents Number systems and conversion Binary arithmetic Representation of negative numbers Addition of two s complement numbers Addition of one s complement numbers Binary s Readings Unit.~. UNIT NUMBER

### Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Digital Arithmetic Digital Arithmetic: Operations and Circuits Dr. Farahmand Binary Arithmetic Digital circuits are frequently used for arithmetic operations Fundamental arithmetic operations on binary

### Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Data Representation ti and Arithmetic for Computers Rui Wang, Assistant professor Dept. of Information and Communication Tongji University it Email: ruiwang@tongji.edu.cn Questions What do you know about

### Final Labs and Tutors

ICT106 Fundamentals of Computer Systems - Topic 2 REPRESENTATION AND STORAGE OF INFORMATION Reading: Linux Assembly Programming Language, Ch 2.4-2.9 and 3.6-3.8 Final Labs and Tutors Venue and time South

### Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Course Schedule CS 221 Computer Architecture Week 3: Information Representation (2) Fall 2001 W1 Sep 11- Sep 14 Introduction W2 Sep 18- Sep 21 Information Representation (1) (Chapter 3) W3 Sep 25- Sep

### Binary Arithmetic. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T.

Binary Arithmetic Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. MIT 6.004 Fall 2018 Reminder: Encoding Positive Integers Bit i in a binary representation (in right-to-left order)

### Lecture 6: Signed Numbers & Arithmetic Circuits. BCD (Binary Coded Decimal) Points Addressed in this Lecture

Points ddressed in this Lecture Lecture 6: Signed Numbers rithmetic Circuits Professor Peter Cheung Department of EEE, Imperial College London (Floyd 2.5-2.7, 6.1-6.7) (Tocci 6.1-6.11, 9.1-9.2, 9.4) Representing

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

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 APPENDIX A.1 Number systems and codes Since ten-fingered humans are addicted to the decimal system, and since computers

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

Positional notation Ch.. /continued Conversions between Decimal and Binary Binary to Decimal - use the definition of a number in a positional number system with base - evaluate the definition formula using

### Chapter 4: Computer Codes. In this chapter you will learn about:

Ref. Page Slide 1/30 Learning Objectives In this chapter you will learn about: Computer data Computer codes: representation of data in binary Most commonly used computer codes Collating sequence Ref. Page

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

IT 1204 Section 2.0 Data Representation and Arithmetic 2009, University of Colombo School of Computing 1 What is Analog and Digital The interpretation of an analog signal would correspond to a signal whose

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

Complement Number Systems A complement number system is used to represent positive and negative integers A complement number system is based on a fixed length representation of numbers Pretend that integers

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

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES Structure 2.1 Introduction 2.2 Objectives 2.3 Binary Numbers 2.3.1 Binary-to-Decimal conversion 2.3.2 Decimal-to-Binary Conversion 2.4 Octal Numbers

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

Basic Definition REPRESENTING INTEGER DATA Englander Ch. 4 An integer is a number which has no fractional part. Examples: -2022-213 0 1 514 323434565232 Unsigned and -Coded Decimal BCD: -Coded Decimal

### SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT Mathematics Numbers & Number Systems Introduction Numbers and Their Properties Multiples and Factors The Division Algorithm Prime and Composite Numbers Prime Factors

### Introduction to Computer Science-103. Midterm

Introduction to Computer Science-103 Midterm 1. Convert the following hexadecimal and octal numbers to decimal without using a calculator, showing your work. (6%) a. (ABC.D) 16 2748.8125 b. (411) 8 265

### What Is It? Instruction Register Address Register Data Register

What Is It? Consider the following set of 32 binary digits, written in blocks of four so that the example is not impossible to read. 0010 0110 0100 1100 1101 1001 1011 1111 How do we interpret this sequence

### ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

### Principles of Computer Architecture. Chapter 3: Arithmetic

3-1 Chapter 3 - Arithmetic Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 3: Arithmetic 3-2 Chapter 3 - Arithmetic 3.1 Overview Chapter Contents 3.2 Fixed Point Addition

### COMP Overview of Tutorial #2

COMP 1402 Winter 2008 Tutorial #2 Overview of Tutorial #2 Number representation basics Binary conversions Octal conversions Hexadecimal conversions Signed numbers (signed magnitude, one s and two s complement,

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

Number System (Different Ways To Say How Many) Fall 2016 Introduction to Information and Communication Technologies CSD 102 Email: mehwish.fatima@ciitlahore.edu.pk Website: https://sites.google.com/a/ciitlahore.edu.pk/ict/

### 1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

Chapter 1. 1.1. INTRODUCTION Digital computers have brought about the information age that we live in today. Computers are important tools because they can locate and process enormous amounts of information

### Digital Systems. John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC. December 6, 2012

Digital Systems John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC December 6, 2012 Contents 1 Logic Gates 3 1.1 Logic Gate............................. 3 1.2 Truth

### TOPICS. Other Number Systems. Other Number Systems 9/9/2017. Octal Hexadecimal Number conversion

Topic : Introduction To computers Faculty : Department of commerce and Management BY: Prof.Meeta R. Gujarathi E mail: meetargujarathi@gmail.com Octal Hexadecimal Number conversion TOPICS Other Number Systems

### Topic Notes: Bits and Bytes and Numbers

Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2010 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review, but we will go over it for

### Digital Systems and Binary Numbers

Digital Systems and Binary Numbers Prof. Wangrok Oh Dept. of Information Communications Eng. Chungnam National University Prof. Wangrok Oh(CNU) 1 / 51 Overview 1 Course Summary 2 Binary Numbers 3 Number-Base

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

DLD UNIT III Combinational Circuits (CC), Analysis procedure, Design Procedure, Combinational circuit for different code converters and other problems, Binary Adder- Subtractor, Decimal Adder, Binary Multiplier,

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

Moodle 1 WILLINGDON COLLEGE SANGLI ELECTRONICS (B. Sc.-I) Introduction to Number System E L E C T R O N I C S Introduction to Number System and Codes Moodle developed By Dr. S. R. Kumbhar Department of

### 1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1.1 Introduction Given that digital logic and memory devices are based on two electrical states (on and off), it is natural to use a number

### Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University How do we represent data in a computer?!

### ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

### Internal Data Representation

Appendices This part consists of seven appendices, which provide a wealth of reference material. Appendix A primarily discusses the number systems and their internal representation. Appendix B gives information

### CS 261 Fall Binary Information (convert to hex) Mike Lam, Professor

CS 261 Fall 2018 Mike Lam, Professor 3735928559 (convert to hex) Binary Information Binary information Topics Base conversions (bin/dec/hex) Data sizes Byte ordering Character and program encodings Bitwise

### COMP2611: Computer Organization. Data Representation

COMP2611: Computer Organization Comp2611 Fall 2015 2 1. Binary numbers and 2 s Complement Numbers 3 Bits: are the basis for binary number representation in digital computers What you will learn here: How

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

Chapter 2 Positional number systems A positional number system represents numeric values as sequences of one or more digits. Each digit in the representation is weighted according to its position in the

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

// EE : INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN Lecture : Introduction /9/ Avinash Kodi, kodi@ohio.edu Agenda Go over the syllabus Introduction ti to Digital it Systems // Why Digital Systems?

### plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

plc numbers - 3. 3. NUMBERS AND DATA Topics: Number bases; binary, octal,, hexa Binary calculations; s compliments, addition, subtraction and Boolean operations Encoded values; BCD and ASCII Error detection;

### Chapter 4 Arithmetic Functions

Logic and Computer Design Fundamentals Chapter 4 Arithmetic Functions Charles Kime & Thomas Kaminski 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Overview Iterative combinational

### ECOM 2325 Computer Organization and Assembly Language. Instructor: Ruba A.Salamah INTRODUCTION

ECOM 2325 Computer Organization and Assembly Language Instructor: Ruba A.Salamah INTRODUCTION Overview Welcome to ECOM 2325 Assembly-, Machine-, and High-Level Languages Assembly Language Programming Tools

### World Inside a Computer is Binary

C Programming 1 Representation of int data World Inside a Computer is Binary C Programming 2 Decimal Number System Basic symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Radix-10 positional number system. The radix

Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 2150 (Tarnoff) Computer Organization TEST 1 for Spring Semester,