Digital Systems and Binary Numbers

Size: px
Start display at page:

Download "Digital Systems and Binary Numbers"

Transcription

1 Digital Systems and Binary Numbers Prof. Wangrok Oh Dept. of Information Communications Eng. Chungnam National University Prof. Wangrok Oh(CNU) 1 / 51

2 Overview 1 Course Summary 2 Binary Numbers 3 Number-Base Conversions 4 Octal and Hexadecimal Numbers 5 Complements of Numbers 6 Signed Binary Numbers 7 Binary Codes 8 Binary Storage and Registers 9 Binary Logic Prof. Wangrok Oh(CNU) 2 / 51

3 Course Summary Lecturer: Wangrok Oh Office: Room 421-1, Engineering Building #3 T E. Text Book M. Morris Mano and Michael D. Ciletti, Digital Design with an Introduction to the Verilog HDL, 5th ed., Pearson Course Objective Equip the students with a solid understanding of digital systems and to introduce them to the methodology of modern digital design Course Homepage: Grading (tantative) Midterm Exam. (30 %), Final Exam. (40 %), Quiz (20 %), Homework (10 %) Prof. Wangrok Oh(CNU) Course Summary 3 / 51

4 Binary Numbers A decimal number 7, A number with a decimal point: a 5 a 4 a 3 a 2 a 1 a 0.a 1 a 2 a 3 a a a a a a a a a The decimal number system is said to be of base or radix 10 The radix point (the decimal point when 10 is the radix) distinguishes positive powers of 10 from negative powers of 10 Binary number system is a different number system The coefficients have only two possible values: 0 and 1 Each coefficient a j is multiplied by a power of the radix, 2 j and the results are added to obtain the decimal equivalent of the number Binary number = Prof. Wangrok Oh(CNU) Binary Numbers 4 / 51

5 Binary Numbers There are many different number systems In general, a number system with a base r system has coefficients multiplied by powers of r a n r n + a n 1 r n a 1 r + a 0 + a 1 r a m r m The coefficients a j range in value from 0 to r 1 To distinguish between numbers of different bases, we enclose the coefficients in parentheses and write a subscript equal to the base used (4021.2) 5 = = (511.4) 10 (127.4) 8 = = (87.5) 10 What should we do when the base of the number is greater than 10? Hexadecimal number system: Base=16 The first 10 digits are borrowed from the decimal number systems Prof. Wangrok Oh(CNU) Binary Numbers 5 / 51

6 Binary Numbers The letters A, B, C, D, E and F are used for the digits 10, 11, 12, 13, 14 and 15, respectively (B65F) 16 = = (46687) 10 Hexadecimal number system is used commonly to represent long strings of bits = (B65F) 16 B 6 5 F The digits in a binary number are called bits When a bit is equal to 0, it does not contribute to the sum during the conversion Adding only the numbers with powers of two corresponding to the bits equal to 1 (110101) 2 = = = (53) 10 In computer work, 2 10 is referred to as K (kilo), 2 20 as M (mega), 2 30 as G (giga) and 2 40 as T (tera) A byte is equal to eight bits Prof. Wangrok Oh(CNU) Binary Numbers 6 / 51

7 in the addresses, instructions, and data in digital systems. partial For example, product: B65F is used to 1011 represent As noted before, the digits in a binary number are called bits. product: When a bit is equal to 0, it does not contribute to the sum during the conversion. Therefore, the conversion from binary Table 1.1 to decimal can be obtained by adding only the numbers with powers of two Powers of Two corresponding to the bits that are equal Powers to 1. of For Two example, n 2 n (110101) n 2 n n 2 n 2 = = (53) 10 Binary Numbers There 0 are four 1 s 1 in the binary 8 number. 256 The corresponding 16 decimal 65,536 number is the sum of the four 1 powers of 2 two. Zero 9 and the first numbers obtained 17 from 131,072 2 to the power of n are listed 2 in Table In computer 10 work, 1, (1K) is referred 18 to as K (kilo), 262, as M (mega), 2 30 as G (giga), 3 and as T (tera). 11 Thus, 4K 2,048 = 2 12 = 4,09619 and 16M = 524,288 2 = 16,777,216. Computer 4 capacity 16 is usually 12 given in bytes. 4,096 A (4K) byte is equal 20 to eight 1,048,576 bits and (1M) can accommodate (i.e., 5 represent 32 the code 13 of) one 8,192 keyboard character. 21 A computer 2,097,152 hard disk with four gigabytes 6 of storage 64 has a 14 capacity 16,384 of 4G = 2 32 bytes 22 (approximately 4,194,304 4 billion bytes). A terabyte 7 is gigabytes, approximately 15 32,768 1 trillion bytes. 23 8,388,608 Arithmetic operations with numbers in base r follow the same rules as for decimal numbers. Arithmetic When operations a base other with than the numbers familiar in base base 10 is rused, follow one the must same be careful rulesto use only the r allowable digits. Examples of addition, subtraction, and multiplication of two as binary for decimal numbers numbers are as follows: augend: minuend: multiplicand: 1011 addend: subtrahend: multiplier: * 101 sum: difference: partial product: 1011 product: Table 1.1 Prof. Wangrok Powers Oh(CNU) of Two Binary Numbers 7 / 51

8 Number-Base Conversions Representations of a number in a different radix are said to be equivalent if they have the same decimal representations A number in base r to decimal: Expanding the number in a power series and adding all the terms A decimal number to a number in base r: Dividing the number and all successive quotients by r and accumulating the remainders Example (Convert Decimal 41 to Binary) 1 41 is divided by 2 to give an integer quotient of 20 and the remainder of 1 2 The quotient, 20 is again divided by 2 to give a new quotient 10 and the remainder 0 3 Repeat this until a new quotient is 0 4 The coefficients of the desired binary number are obtained from the remainders Prof. Wangrok Oh(CNU) Number-Base Conversions 8 / 51

9 Number-Base Conversions 41 = a 0 = 1 20 = a 1 = 0 10 = a 2 = 0 5 = a 3 = 1 2 = a 4 = 0 1 = a 5 = 1 The answer is (41) 10 = (a 5 a 4 a 3 a 2 a 1 a 0 ) 2 = (101001) 2 41 = = = = ( ) + 1 = Prof. Wangrok Oh(CNU) Number-Base Conversions 9 / 51

10 Number-Base Conversions The arithmetic process can be manipulated more conveniently Integer Quotient Remainder Prof. Wangrok Oh(CNU) Number-Base Conversions 10 / 51

11 Number-Base Conversions Example (Convert Decimal 153 to Octal) The required base r is 8 The answer is (153) 10 = (231) 8 Integer Quotient Remainder The conversion of a decimal fraction to binary is accomplished by a method similar to that used for integers Multiplication is used instead of division and integers instead of remainders are accumulated Prof. Wangrok Oh(CNU) Number-Base Conversions 11 / 51

12 Number-Base Conversions Example (Convert (0.6875) 10 to Binary) is multiplied by 2 to give an integer and a fraction 2 New fraction is multiplied by 2 to give a new integer and a new fraction 3 Repeat this until the fraction becomes 0 or until the number of digits has sufficient accuracy = a 1 = = a 2 = = a 3 = = a 4 = 1 Prof. Wangrok Oh(CNU) Number-Base Conversions 12 / 51

13 Number-Base Conversions = 1 ( ) 2 ( ) ( ) = 1 2 ( ( ( ) ) ) = ( = = ( 1 2) 3 + = (0.1011) ( ) ( ) ) 2 (1 + 0) Prof. Wangrok Oh(CNU) Number-Base Conversions 13 / 51

14 Number-Base Conversions Example (Convert (0.513) 10 to Octal) = = = = = = The answer, to seven significant figures, is obtained from the integer part of the products: ( ) 8 Prof. Wangrok Oh(CNU) Number-Base Conversions 14 / 51

15 Number-Base Conversions The conversion of decimal numbers with both integer and fraction parts is done by converting the integer and the fraction separately and then combining the two answers For example, ( ) 10 = ( ) 2 Prof. Wangrok Oh(CNU) Number-Base Conversions 15 / 51

16 Octal and Hexadecimal Numbers Too long binary sequence is not easy to recognize The conversion from and to binary, octal and hexadecimal plays an important role in digital computers Since 2 3 = 8 and 2 4 = 16, each octal and hexadecimal digit correspond to 3 and 4 binary digits, respectively Binary to octal is easily accomplished by partitioning the binary number into groups of three digits starting from the binary point and proceeding to the left and to the right ( ) 2 = ( ) 8 6 Binary to hexadecimal is accomplished by partitioning the binary number into groups of four digits starting from the binary point and proceeding to the left and to the right ( ) 2 = (2C6B.F2) 16 2 C 6 B F 2 Prof. Wangrok Oh(CNU) Octal and Hexadecimal Numbers 16 / 51

17 Octal and Hexadecimal Numbers Conversion from octal or hexadecimal to binary is done by reversing the preceding procedure ( ) 8 = ( (306.D) 15 = ( D ) ) 2 Prof. Wangrok Oh(CNU) Octal and Hexadecimal Numbers 17 / 51

18 Octal and Hexadecimal Numbers Section 1.4 Octal and Hexadecimal Numbers 9 Table 1.2 Numbers with Different Numbers Bases with Different Bases Decimal (base 10) Binary (base 2) Octal (base 8) Hexadecimal (base 16) A B C D E F Prof. Wangrok Oh(CNU) Octal and Hexadecimal Numbers 18 / 51

19 Complements of Numbers Complements are used in digital computers to simplify the subtraction operation and logical manipulation Simplifying operations leads to simpler, less expensive circuits to implement the operations There are two types of complements for each base-r system 1 Radix complement: r s complement 2 Diminished radix complement: (r 1) s complement Definition (Diminished Radix Complement) Given a number N in base r having n digits, the (r 1) s complement of N is defined as (r n 1) N For decimal numbers: r = 10 (r 1) = 9 9 s complement of N = (10 n 1) N 9 s complement is obtained by subtracting each digit from 9 Prof. Wangrok Oh(CNU) Complements of Numbers 19 / 51

20 Complements of Numbers For binary numbers: r = 2 (r 1) = 1 1 s complement of N = (2 n 1) N Since 1 0 = 1 and 1 1 = 0, the 1 s complement of a binary number is formed by changing 1 s to 0 s and 0 s to 1 s Example (Diminished Radix Complement) The 9 s complement of = The 9 s complement of = The 1 s complement of = The 1 s complement of = Prof. Wangrok Oh(CNU) Complements of Numbers 20 / 51

21 Complements of Numbers Definition (Radix Complement) Given a number N in base r having n digits, the r s complement of N is defined as r n N for N 0 and as 0 for N = 0 Note that r n N = [ (r n 1) N ] + 1 Comparing with the (r 1) s complement, the r s complement is obtained by adding 1 to the (r 1) s complement 10 s complement of N can be formed also as follows: 1 Leaving all least significant 0 s unchanged 2 Subtracting the first nonzero least significant digit from 10 3 Subtracting all higher significant digits from Prof. Wangrok Oh(CNU) Complements of Numbers 21 / 51

22 Complements of Numbers 2 s complement of N can be formed also as follows: 1 Leaving all least significant 0 s and the first 1 unchanged 2 Replacing 1 s with 0 s and 0 s with 1 s in all other higher significant digits If the original number N contains a radix point: 1 The radix point should be removed temporarily in order to form the r s or (r 1) s complement 2 Radix point is then restored to the complemented number in the same relative position The complement of the complement restores the number to its original value r n (r n N) = N Prof. Wangrok Oh(CNU) Complements of Numbers 22 / 51

23 Complements of Numbers Subtraction with complement The direct method of subtraction is efficient when people perform subtraction with paper and pencil When subtraction is implemented with digital hardware, the method is less efficient than the method that uses complements Subtraction of two n-digit unsigned numbers (M N) in base r 1 Add the minuend M to the r s complement of the subtrahend N: M + (r n N) = M N + r n 2 If M N, the sum will produce an end carry r n which can be discarded 3 If M < N, the sum does not produce an end carry and is equal to r n (N M) which is the r s complement of (N M) To obtain the answer, take the r s complement of the sum and place a negative sign in front Prof. Wangrok Oh(CNU) Complements of Numbers 23 / 51

24 Complements of Numbers Example ( ) M = s complement of N = Sum = Discard end carry 10 5 = Example ( ) M = s complement of N = Sum = s complement of the sum = (10 s complement of the sum) = Prof. Wangrok Oh(CNU) Complements of Numbers 24 / 51

25 Complements of Numbers Example (X = and Y = ) 1 (X Y ) X = s complement of Y = Sum = Discard end carry 2 7 = (Y X) Y = s complement of X = Sum = s complement of the sum = (2 s complement of the sum) = Prof. Wangrok Oh(CNU) Complements of Numbers 25 / 51

26 Complements of Numbers Subtraction of unsigned numbers can also be done by means of the (r 1) s complement Remember that the (r 1) s complement is one less than the r s complement The sum is one less than the correct difference when an end carry occurs Removing the end carry and adding 1 to the sum Prof. Wangrok Oh(CNU) Complements of Numbers 26 / 51

27 Complements of Numbers Example (X = and Y = ) 1 (X Y ) X = s complement of Y = Sum = Discard end carry 2 7 = Add end-around carry = 1 Answer = (Y X) Y = s complement of X = Sum = s complement of the sum = (1 s complement of the sum) = Prof. Wangrok Oh(CNU) Complements of Numbers 27 / 51

28 Signed Binary Numbers To represent negative numbers, we need a notation for negative values In ordinary arithmetic, a negative number is indicated by a minus sign and a positive number by a plus sign Because of hardware limitations, computers must represent everything with binary digits, 0 or 1 The leftmost position of the number is used to represent the sign Sign bit 0 for positive and 1 for negative Signed The leftmost bit represents the sign and the rest of the bits represent the number Unsigned The leftmost bit is the most significant bit of the number 01001: Signed +9/Unsigned : Signed 9/Unsigned 25 The representation of the signed numbers in the above example is referred to as the signed-magnitude convention Prof. Wangrok Oh(CNU) Signed Binary Numbers 28 / 51

29 Signed Binary Numbers When arithmetic operations are implemented in a computer, it is more convenient to use a different system, referred to as the signed-complement system A negative number is indicated by its complement Note that the signed-magnitude system negates a number by changing its sign Signed-complement system negates a number by taking its complement The signed-complement system can use either the 1 s or the 2 s complement 2 s complement is the most common Consider the number 9 represented in binary with eight bits +9 = = with signed-magnitude 9 = with signed 1 s complement 9 = with signed 2 s complement Prof. Wangrok Oh(CNU) Signed Binary Numbers 29 / 51

30 Signed Binary Numbers 16 Chapter 1 Digital Systems and Binary Numbers Table 1.3 Signed Binary Numbers Decimal Signed Binary Numbers Signed 2 s Complement Signed 1 s Complement Signed Magnitude The positive numbers in all three representations are identical The signed-2 s complement system has only one representation for 0 representation of negative numbers. The same procedures can be applied to the signed 1 s complement system by including the end around carry as is done with unsigned numbers. Prof. Wangrok Oh(CNU) Signed Binary Numbers 30 / 51

31 Signed Binary Numbers With four bits, we can represent 16 binary numbers In the 1 scomplement, there are eight positive numbers and eight negative numbers In the 2 s-complement, there are seven positive numbers, one zero and eight negative numbers Arithmetic Addition The addition of two signed 2 s Section complement 1.6 Signed binary Binary numbers Numbers is 17 obtained from the addition of the two numbers including their sign Numerical A examples carry out of for the addition sign-bit follow: position is discarded Note that negative numbers must be initially in 2 s complement form and that if the sum obtained after the addition is negative, it is in 2 s complement form. For example, -7 is Prof. Wangrok Oh(CNU) Signed Binary Numbers 31 / 51

32 Signed Binary Numbers Arithmetic Subtraction Subtraction procedure Take the 2 s complement of the subtrahend including the sign bit Add it to the minuend including the sign bit A carry out of the sign-bit position is discarded This procedure is adopted because a subtraction can be changed to an addition (±A) (±B) = (±A) + ( B) Changing a positive number to a negative number is easily done by taking the 2 s complement ( 6) ( 13) = ( 6) + (+13) = = Removing the end carry, we obtain the answer Prof. Wangrok Oh(CNU) Signed Binary Numbers 32 / 51

33 Binary Codes number in BCD is the same as its equivalent binary number only when the number is between 0 and 9. A BCD number greater than 10 looks different from its equivalent binary number, even though both contain 1 s and 0 s. Moreover, the binary combinations 1010 through 1111 are not used and have no meaning in BCD. C o n s i d e r d e c i m a l 185 and its corresponding value in BCD and binary: An n-bit binary code (185) is a group of n bits 2 n 10 = ( ) BCD = ( ) distinct 2 combinations of 1 s and 0 s 2 n elements can be represented Binary Coded Decimal Code Table 1.4 Binary Coded Decimal (BCD) Commonly referred to as (8421-) BCD Decimal BCD Each group of 4 bits representing one decimal digit Symbol Digit Binary combinations 1010 through 1111 are not used (185) 10 = ( ) BCD = ( ) 2 BCD needs more bits than its equivalent binary representation BCD is more readable than binary representation Prof. Wangrok Oh(CNU) Binary Codes 33 / 51

34 from a previous less significant pair of digits. Since each digit does not exceed 9, the sum cannot be greater than = 19, with the 1 being a previous carry. Suppose we add the BCD digits as if they were binary numbers. Then the binary sum will produce a result in the range from 0 to 19. In binary, this range will be from 0000 to 10011, but in BCD, it is from 0000 to , with the first (i.e., leftmost) 1 being a carry and the next four bits being the BCD sum. When the binary sum is equal to or less than 1001 (without a carry), the corresponding BCD digit is correct. However, when BCD the Addition binary sum is greater than or equal to 1010, the result is an invalid BCD digit. The When addition the sum of 6 = is equal (0110) to 2 to orthe less binary than sum 1001converts BCDit digit to the iscorrect digit and also produces When the a carry sumas is required. greater than This or is equal because to 1010 a carry in the most significant bit position of The the binary result isum an and invalid a decimal BCD carry differ by = 6. Consider the following three The addition BCD additions: of 6 to the sum converts it to the correct BCD Binary Codes In each This case, is the because two BCD a carry digits inare theadded mostas significant if they were bit two position binary of numbers. the If the binary sum binary is greater sum and than a or decimal equal to carry 1010, differ we add by to obtain = 6 the correct BCD sum and a carry. In the first example, the sum is equal to 9 and is the correct BCD sum. In the second example, the binary sum produces an invalid BCD digit. The addition of 0110 produces the correct BCD sum, 0010 (i.e., the number 2), and a carry. In the third example, the binary sum produces a carry. This condition occurs when the sum is greater than or equal to 16. Although the other four bits are less than 1001, the binary sum Prof. Wangrok Oh(CNU) Binary Codes 34 / 51

35 Binary Codes Section 1.7 Binary Codes 21 Th e a d d i t i o n o f t w o n digit unsigned BCD numbers follows the same procedure. Consider Addition the addition of two of n-digit BCD 576 = numbers 760 in BCD: Decimal Arithmetic BCD Binary sum Add BCD sum The first, least significant pair of BCD digits produces a BCD digit sum of 0000 and a carry for the next pair of digits. The second pair of BCD digits plus a previous carry Signed decimal numbers in BCD is similar to the signed binary produces a digit sum of 0110 and a carry for the next pair of digits. The third pair of number digits plus a carry produces a binary sum of 0111 and does not require a correction. A plus with four 0 s (0000) and a minus with 9 (1001) The signed-magnitude system is seldom used in computers Decimal Arithmetic The signed-complement system can be either the 9 s or the 10 s The representation complement of signed decimal numbers in BCD is similar to the representation of signed 10 s numbers complement in binary. We is the can one use most either often the familiar used signed magnitude system or the Addition signed complement system. The sign of a decimal number is usually represented with four bits to conform to the four bit code of the decimal digits. It is customary to 1 Summing all digits including the sign digit designate a plus with four 0 s and a minus with the BCD equivalent of 9, which is Discarding the end carry The signed magnitude system is seldom used in computers. The signed complement system can be either the 9 s or the 10 s complement, but the 10 s complement is the one most often used. To obtain the 10 s complement of a BCD number, we first take the 9 s Prof. Wangrok Oh(CNU) Binary Codes 35 / 51

36 Binary Codes lated from the subtraction of each digit from 9. Th e p ro c e d u re s d e v e l o p e d f o r t h e s i g n e d 2 s complement system in the previous section also apply to the signed 10 s complement system for decimal numbers. Addition is done by summing all digits, including the sign digit, and discarding the end carry. This operation assumes that all negative numbers are in 10 s complement form. Consider the addition (+375) + (-240) = +135, done in the signed complement system: The Subtraction 9 in the leftmost position of the second number represents a minus, and 9760 is the 10 s complement of The two numbers are added and the end carry is discarded to 1 Take obtain the s Of complement course, the decimal of the subtrahend numbers inside the computer, including the sign 2 digits, Add it must to the be minuend in BCD. The addition is done with BCD digits as described previously. The subtraction of decimal numbers, either unsigned or in the signed 10 s complement system, Binary is the codes same as for in decimal the binary digits case: Take require the 10 s a minimum complement of of four the bits subtrahend per and add digit it to the minuend. Many computers have special hardware to perform arithmetic Many different codes can be formulated by arranging four bits into 10 distinct combinations Each code uses only 10 out of a possible 16 bit combinations that can be arranged with four bits The other six unused combinations have no meaning and should be avoided Other Decimal Codes Prof. Wangrok Oh(CNU) Binary Codes 36 / 51

37 Binary Codes Table 1.5 Four Different Binary Codes for the Decimal Digits Decimal Digit BCD Excess 3 8, 4, 2, Unused bit combi nations BCD and the 2421 code are examples of weighted codes In a weighted code, each bit position is assigned a weighting factor BCD code has weights of 8, 4, 2 and code has weights of 2, 4, 2 and 1 (0110) BCD = = 6 (1101) 2421 = = 7 Prof. Wangrok Oh(CNU) Binary Codes 37 / 51

38 Binary Codes Note that some digits can be coded in two possible ways in the 2421 code: 4 = (0100) 2421 = (1010) and excess-3 codes are examples of self-complementing codes 9 s complement of a decimal number is obtained directly by changing 1 s to 0 s and 0 s to 1 s (395) 10 = ( ) Excess-3 (604) 10 = ( ) Excess-3 The excess-3 code has been used in some older computers because of its self-complementing property Excess-3 is an unweighted code in which each coded combination is obtained from the corresponding binary value plus 3 The 8, 4, - 2, - 1 code is an example of assigning both positive and negative weights to a decimal code (0110) 8,4, 2, 1 = ( 2) + 0 ( 1) = 2 Prof. Wangrok Oh(CNU) Binary Codes 38 / 51

39 Binary Codes Gray Code 24 Chapter 1 Digital Systems and Binary Numbers Only one bit in the code group changes in going from one number to the next Table 1.6 Gray Code Gray Code Decimal Equivalent Gray code cannot be used in arithmetic circuits ASCII Character It is quite Code difficult to translate from decimal numbers to the Gray code and back to decimal again M a n y a p p l i c a t i o n s o f d i g i t a l c o m p u t e r s re q u i re t h e h a n d l i n g n o t o n l y o f n u m b e r s, b u t also of other characters or symbols, such as the letters of the alphabet. For instance, consider a high tech company with thousands of employees. To represent the names Prof. Wangrok Oh(CNU) Binary Codes 39 / 51

40 Gray Code Binary Codes Generation of Gray code Gray code for n bits can be generated recursively by prefixing a binary 0 to the Gray code for n-1 bits, then prefixing a binary 1 to the reflected Generation of Gray code: I 1 Copy 2 Mirroring 3 Prepending 0 s and 1 s Generation of Gray code: II Div. Electrical and Computer Engineering Chungnam 1 National Start University from binary notation 14 2 Copy the MSB 3 Perform exclusive-or between two adjacent bits from right to left (13) 10 = (1101) 2 (1011) Gray Prof. Wangrok Oh(CNU) Binary Codes 40 / 51

41 Binary Codes Applications of Gray code 1 Optical Shaft Prof. Wangrok Oh(CNU) Binary Codes 41 / 51

42 Binary Codes Gray Code Digital Systems DesignProf. Wan Gray codes are also used in labeling the axes of Karnau maps 2 Labelling the axes of Karnaugh maps CD AB Y=BD Div. Electrical and Computer Engineering Chungnam National University Prof. Wangrok Oh(CNU) Binary Codes 42 / 51

43 Binary Codes 3 Signal constellation mapping for digital modulation Prof. Wangrok Oh(CNU) Binary Codes 43 / 51

44 Binary Codes ASCII Character Code Many applications of digital computers require to handle characters or symbols The standard binary code for the alphanumeric characters is the American Standard Code for Information Interchange (ASCII) Seven bits to code 128 characters Refer to Table 1.7 for ASCII code table Extended ASCII is also very popular IBM ASCII 8-bit code (256 symbols) Including standard ASCII characters and the additional graphics and math symbols Prof. Wangrok Oh(CNU) Binary Codes 44 / 51

45 Binary Codes AS C I I i s a s e v e n bit code, but most computers manipulate an eight bit quantity as a single unit called a byte. Therefore, ASCII characters most often are stored one per byte. The extra bit is sometimes used for other purposes, depending on the application. For example, some printers recognize eight bit ASCII characters with the most significant bit set to 0. An additional 128 eight bit characters with the most significant bit set to 1 are used for other symbols, such as the Greek alphabet or italic type font. Error Detecting Detecting Code Code To detect errors in data communication and processing, an eighth bit is sometimes added to the ASCII character to indicate its parity A parity bit is an extra bit included with a message to make the total characters number and oftheir 1 s even either and even odd or parity: odd To detect errors in data communication and processing, an eighth bit is sometimes added to the ASCII character to indicate its parity. A parity bit is an extra bit included with a message to make the total number of 1 s either even or odd. Consider the following two With even parity With odd parity ASCII A = ASCII T = In each Thecase, parity we bit insert is helpful an extra inbit detecting the leftmost errors position duringof the transmission code to produce of an even information number of 1 s from in the one character location for to even another parity or an odd number of 1 s in the character for odd parity. In general, one or the other parity is adopted, with even parity being more common. The parity bit is helpful in detecting errors during the transmission of information from one location to another. This function is handled by generating an even parity bit at the sending end for each character. The eight bit characters that include parity bits are transmitted to their destination. The parity of each character is then checked at the receiving end. If the parity of the received character is not even, then at least one bit has changed value during the transmission. This method detects one, three, or any odd com- Prof. Wangrok Oh(CNU) Binary Codes 45 / 51

46 Binary Storage and Registers A binary cell is a device that possesses two stable states and is capable of storing one bit (0 or 1) of information Register A register is a group of binary cells A register with n cells can store any discrete quantity of information that contains n bits (2 n states) Register transfer A digital system is characterized by its registers and the components that perform data processing In digital systems, a register transfer operation is a basic operation transferring of binary information from one set of registers into another set of registers The transfer may be direct from one register to another or may pass through data processing circuits to perform an operation Prof. Wangrok Oh(CNU) Binary Storage and Registers 46 / 51

47 new eight bit code when the keyboard is struck again. Each eight bit character transferred the processor register preceded by a shift of the previous character to the next eight Binary Storage cells on its and left. When Registers a transfer of four characters is completed, the processor register is full, and its contents are transferred into a memory register. The content stored in the MEMORY UNIT J O H N Memory Register PROCESSOR UNIT 8 cells 8 cells 8 cells 8 cells Processor Register INPUT UNIT 8 cells Input Register Keyboard J O H N CONTROL FIGURE 1.1 Transfer of information among registers Prof. Wangrok Oh(CNU) Binary Storage and Registers 47 / 51

48 Binary Storage and Registers To process discrete quantities of information in binary form, a computer must be provided with devices that hold the data to be processed and with circuit elements that manipulate individual bits of information The device most commonly used for holding data is a register Prof. Wangrok Oh(CNU) Binary Storage and Registers 48 / 51

49 Binary Logic Binary logic: binary variables + set of logical operations There are three basic logical operations 1 AND 2 OR 3 NOT Table 1.8 Truth Tables of Logical Operations AND OR NOT x y x # y x y x + y x x Section 1.9 Binary Logic 31 Each operation produces a binary result AND and OR are the same as those used for multiplication and addition. However, binary logic should not be confused with binary arithmetic. One should realize that an arithmetic variable designates a number that may consist of many digits. A logic variable is always either 1 or 0. For example, in binary arithmetic, we have = 10 (read one plus one is equal to 2 ), whereas in binary logic, we have = 1 (read one OR one is equal to one ). Prof. Wangrok Oh(CNU) Binary Logic 49 / 51

50 Binary Logic Logic Gates Logic gates are electronic circuits that operate on one or more input signals to produce an output signal Electrical signals such as voltages or currents exist as analog signals having values over a given continuous range In a digital system, these quantities are interpreted to be either of two recognizable values: 0 or 1 The intermediate region between the allowed regions is crossed only during a state transition Prof. Wangrok Oh(CNU) Binary Logic 50 / 51

51 Binary Logic Chapter Chapter 1 1 Digital Digital Systems Systems and and Binary Numbers Volts Volts FIGURE 1.3 Signal levels for binary logic 0 values FIGURE 1.3 Signal levels for binary logic values 2 Transition occurs between these limits Transition occurs between these limits Signal range Signal for range logic 1for logic 1 Signal range for logic Signal 0 range for logic 0 The graphic symbols used to designate the three types of gates x y z x y x y z x y x (a) Two-input AND z x gate y x (b) Two-input OR z gate x y (c) NOT gate or inverter x x FIGURE y 1.4 y Symbols for digital logic circuits (a) Two-input AND gate (b) Two-input OR gate (c) NOT gate or inverter Prof. Wangrok Oh(CNU) Binary Logic 51 / 51 x x

Lecture (02) Operations on numbering systems

Lecture (02) Operations on numbering systems Lecture (02) Operations on numbering systems By: Dr. Ahmed ElShafee ١ Dr. Ahmed ElShafee, ACU : Spring 2018, CSE202 Logic Design I Complements of a number Complements are used in digital computers to simplify

More information

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

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

More information

Chapter 1. Digital Systems and Binary Numbers

Chapter 1. Digital Systems and Binary Numbers Chapter 1. Digital Systems and Binary Numbers Tong In Oh 1 1.1 Digital Systems Digital age Characteristic of digital system Generality and flexibility Represent and manipulate discrete elements of information

More information

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

CHAPTER TWO. Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER 1 CHAPTER TWO Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER 2-1 Data Types 2-2 Complements 2-3 Fixed-Point Representation 2-4 Floating-Point Representation

More information

Korea University of Technology and Education

Korea University of Technology and Education MEC52 디지털공학 Binary Systems Jee-Hwan Ryu School of Mechanical Engineering Binary Numbers a 5 a 4 a 3 a 2 a a.a - a -2 a -3 base or radix = a n r n a n- r n-...a 2 r 2 a ra a - r - a -2 r -2...a -m r -m

More information

Digital Systems and Binary Numbers

Digital Systems and Binary Numbers Digital Systems and Binary Numbers ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Spring, 2018 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/ Outline

More information

Lecture (03) Binary Codes Registers and Logic Gates

Lecture (03) Binary Codes Registers and Logic Gates Lecture (03) Binary Codes Registers and Logic Gates By: Dr. Ahmed ElShafee Binary Codes Digital systems use signals that have two distinct values and circuit elements that have two stable states. binary

More information

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

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq CS 121 Digital Logic Design Chapter 1 Teacher Assistant Hadeel Al-Ateeq Announcement DON T forgot to SIGN your schedule OR you will not be allowed to attend next lecture. Communication Office hours (8

More information

DIGITAL SYSTEM DESIGN

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

More information

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

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

More information

Digital Systems and Binary Numbers

Digital Systems and Binary Numbers Digital Systems and Binary Numbers Mano & Ciletti Chapter 1 By Suleyman TOSUN Ankara University Outline Digital Systems Binary Numbers Number-Base Conversions Octal and Hexadecimal Numbers Complements

More information

Lecture 2: Number Systems

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

More information

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

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee ١ Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee Digital systems Digital systems are used in communication, business transactions, traffic control, spacecraft guidance, medical

More information

Binary Systems and Codes

Binary Systems and Codes 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 1010101010101010101010101010101010101010101010101010101010101010101010101010101010

More information

Digital Fundamentals

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

More information

Chap 1. Digital Computers and Information

Chap 1. Digital Computers and Information Chap 1. Digital Computers and Information Spring 004 Overview Digital Systems and Computer Systems Information Representation Number Systems [binary, octal and hexadecimal] Arithmetic Operations Base Conversion

More information

Lecture (01) Introduction Number Systems and Conversion (1)

Lecture (01) Introduction Number Systems and Conversion (1) Lecture (01) Introduction Number Systems and Conversion (1) By: Dr. Ahmed ElShafee ١ Digital systems Digital systems are used in communication, business transactions, traffic control, spacecraft guidance,

More information

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

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence GATE Postal Correspondence Computer Sc. & IT 1 Digital Logic Computer Sciencee & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key concepts,

More information

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

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information Logic and Computer Design Fundamentals Chapter 1 Digital Computers and Information Overview Digital Systems and Computer Systems Information Representation Number Systems [binary, octal and hexadecimal]

More information

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

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

More information

Review of Number Systems

Review of Number Systems Review of Number Systems The study of number systems is important from the viewpoint of understanding how data are represented before they can be processed by any digital system including a digital computer.

More information

CHW 261: Logic Design

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

More information

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. 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

More information

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

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

More information

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh LOGIC DESIGN Dr. Mahmoud Abo_elfetouh Course objectives This course provides you with a basic understanding of what digital devices are, how they operate, and how they can be designed to perform useful

More information

EEM 232 Digital System I

EEM 232 Digital System I EEM 232 Digital System I Instructor : Assist. Prof. Dr. Emin Germen egermen@anadolu.edu.tr Course Book : Logic and Computer Design Fundamentals by Mano & Kime Third Ed/Fourth Ed.. Pearson Grading 1 st

More information

ECE 20B, Winter Purpose of Course. Introduction to Electrical Engineering, II. Administration

ECE 20B, Winter Purpose of Course. Introduction to Electrical Engineering, II. Administration ECE 20B, Winter 2003 Introduction to Electrical Engineering, II Instructor: Andrew B Kahng (lecture) Email: abk@eceucsdedu Telephone: 858-822-4884 office, 858-353-0550 cell Office: 3802 AP&M Lecture: TuThu

More information

Chapter 2. Data Representation in Computer Systems

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

More information

MC1601 Computer Organization

MC1601 Computer Organization MC1601 Computer Organization Unit 1 : Digital Fundamentals Lesson1 : Number Systems and Conversions (KSB) (MCA) (2009-12/ODD) (2009-10/1 A&B) Coverage - Lesson1 Shows how various data types found in digital

More information

Computer Organization

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,

More information

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 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,

More information

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 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

More information

Numbering systems. Dr Abu Arqoub

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

More information

Digital Fundamentals

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

More information

Digital Fundamentals

Digital Fundamentals Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Quiz 2 Agenda Lecture: Chapter 2 (2-7 through 2-11):

More information

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

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

More information

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

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects: Numeral Systems -Numeral System -Positional systems -Decimal -Binary -Octal Subjects: Introduction A numeral system (or system of numeration) is a writing system for expressing numbers, that is a mathematical

More information

Chapter 1 Review of Number Systems

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

More information

Get Free notes at Module-I One s Complement: Complement all the bits.i.e. makes all 1s as 0s and all 0s as 1s Two s Complement: One s complement+1 SIGNED BINARY NUMBERS Positive integers (including zero)

More information

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

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

More information

Electronics Engineering ECE / E & T

Electronics Engineering ECE / E & T STUDENT COPY DIGITAL ELECTRONICS 1 SAMPLE STUDY MATERIAL Electronics Engineering ECE / E & T Postal Correspondence Course GATE, IES & PSUs Digital Electronics 2015 ENGINEERS INSTITUTE OF INDIA. All Rights

More information

Positional Number System

Positional Number System Positional Number System A number is represented by a string of digits where each digit position has an associated weight. The weight is based on the radix of the number system. Some common radices: Decimal.

More information

Number System. Introduction. Decimal Numbers

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

More information

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

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS (09 periods) Computer Arithmetic: Data Representation, Fixed Point Representation, Floating Point Representation, Addition and

More information

SE311: Design of Digital Systems

SE311: Design of Digital Systems SE311: Design of Digital Systems Lecture 3: Complements and Binary arithmetic Dr. Samir Al-Amer (Term 041) SE311_Lec3 (c) 2004 AL-AMER ١ Outlines Complements Signed Numbers Representations Arithmetic Binary

More information

Binary Codes. Dr. Mudathir A. Fagiri

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

More information

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

Binary Addition. Add the binary numbers and and show the equivalent decimal addition. 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

More information

Electronic Data and Instructions

Electronic Data and Instructions Lecture 2 - The information Layer Binary Values and Number Systems, Data Representation. Know the different types of numbers Describe positional notation Convert numbers in other bases to base 10 Convert

More information

Digital Logic Lecture 2 Number Systems

Digital Logic Lecture 2 Number Systems Digital Logic Lecture 2 Number Systems By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department Outline Introduction. Basic definitions. Number systems types. Conversion between different

More information

Number Systems Base r

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

More information

in this web service Cambridge University Press

in this web service Cambridge University Press 978-0-51-85748- - Switching and Finite Automata Theory, Third Edition Part 1 Preliminaries 978-0-51-85748- - Switching and Finite Automata Theory, Third Edition CHAPTER 1 Number systems and codes This

More information

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

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

More information

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

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

More information

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan Number Systems Dr. Tarek A. Tutunji Philadelphia University, Jordan Number Systems Programmable controllers use binary numbers in one form or another to represent various codes and quantities. Every number

More information

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

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem   ahmadsm AT kfupm Phone: Office: COE 0: Digital Logic Design Number Systems Part Dr. Ahmad Almulhem Email: ahmadsm AT kfupm Phone: 860-7554 Office: -34 Objectives Arithmetic operations: Binary number system Other number systems Base Conversion

More information

Number representations

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

More information

Combinational Logic. Prof. Wangrok Oh. Dept. of Information Communications Eng. Chungnam National University. Prof. Wangrok Oh(CNU) 1 / 93

Combinational Logic. Prof. Wangrok Oh. Dept. of Information Communications Eng. Chungnam National University. Prof. Wangrok Oh(CNU) 1 / 93 Combinational Logic Prof. Wangrok Oh Dept. of Information Communications Eng. Chungnam National University Prof. Wangrok Oh(CNU) / 93 Overview Introduction 2 Combinational Circuits 3 Analysis Procedure

More information

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

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?

More information

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

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

More information

NUMBER SYSTEMS AND CODES

NUMBER SYSTEMS AND CODES C H A P T E R 69 Learning Objectives Number Systems The Decimal Number System Binary Number System Binary to Decimal Conversion Binary Fractions Double-Dadd Method Decimal to Binary Conversion Shifting

More information

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

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

More information

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

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

More information

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

Digital Systems COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals Digital Systems COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals Welcome to COE 202 Course Webpage: http://faculty.kfupm.edu.sa/coe/mudawar/coe202/ Lecture

More information

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 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

More information

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

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 ) +(

More information

MACHINE LEVEL REPRESENTATION OF DATA

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

More information

COMBINATIONAL LOGIC CIRCUITS

COMBINATIONAL LOGIC CIRCUITS COMBINATIONAL LOGIC CIRCUITS 4.1 INTRODUCTION The digital system consists of two types of circuits, namely: (i) Combinational circuits and (ii) Sequential circuits A combinational circuit consists of logic

More information

Chapter 3: part 3 Binary Subtraction

Chapter 3: part 3 Binary Subtraction Chapter 3: part 3 Binary Subtraction Iterative combinational circuits Binary adders Half and full adders Ripple carry and carry lookahead adders Binary subtraction Binary adder-subtractors Signed binary

More information

Number Systems CHAPTER Positional Number Systems

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

More information

Chapter 4 Arithmetic Functions

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

More information

CS & IT Conversions. Magnitude 10,000 1,

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

More information

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

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

More information

Computer Organization

Computer Organization Computer Organization It describes the function and design of the various units of digital computers that store and process information. It also deals with the units of computer that receive information

More information

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Dec Hex Bin ORG ; ZERO. Introduction To Computing Dec Hex Bin 0 0 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and

More information

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. 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

More information

Bits, Words, and Integers

Bits, Words, and Integers Computer Science 52 Bits, Words, and Integers Spring Semester, 2017 In this document, we look at how bits are organized into meaningful data. In particular, we will see the details of how integers are

More information

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B)

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B) COMPUTER ARITHMETIC 1. Addition and Subtraction of Unsigned Numbers The direct method of subtraction taught in elementary schools uses the borrowconcept. In this method we borrow a 1 from a higher significant

More information

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES Structure 2.0 Introduction 2.1 Unit Objectives 2.2 Number Systems 2.3 Bits and Bytes 2.4 Binary Number System 2.5 Decimal Number System 2.6 Octal Number System

More information

UNIT 7A Data Representation: Numbers and Text. Digital Data

UNIT 7A Data Representation: Numbers and Text. Digital Data UNIT 7A Data Representation: Numbers and Text 1 Digital Data 10010101011110101010110101001110 What does this binary sequence represent? It could be: an integer a floating point number text encoded with

More information

Chapter 2 Number Systems and Codes Dr. Xu

Chapter 2 Number Systems and Codes Dr. Xu Chapter 2 Number Systems and Codes Dr. Xu Chapter 2 Objectives Selected areas covered in this chapter: Converting between number systems. Decimal, binary, hexadecimal. Advantages of the hexadecimal number

More information

Binary. Hexadecimal BINARY CODED DECIMAL

Binary. Hexadecimal BINARY CODED DECIMAL Logical operators Common arithmetic operators, like plus, minus, multiply and divide, works in any number base but the binary number system provides some further operators, called logical operators. Meaning

More information

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 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

More information

Chapter 2: Number Systems

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

More information

COMPUTER ORGANIZATION AND ARCHITECTURE

COMPUTER ORGANIZATION AND ARCHITECTURE COMPUTER ORGANIZATION AND ARCHITECTURE For COMPUTER SCIENCE COMPUTER ORGANIZATION. SYLLABUS AND ARCHITECTURE Machine instructions and addressing modes, ALU and data-path, CPU control design, Memory interface,

More information

Module -10. Encoder. Table of Contents

Module -10. Encoder. Table of Contents 1 Module -10 Encoder Table of Contents 1. Introduction 2. Code converters 3. Basics of Encoder 3.1 Linear encoders 3.1.1 Octal to binary encoder 3.1.2 Decimal to BCD encoder 3.1.3 Hexadecimal to binary

More information

Announcement. (CSC-3501) Lecture 3 (22 Jan 2008) Today, 1 st homework will be uploaded at our class website. Seung-Jong Park (Jay)

Announcement. (CSC-3501) Lecture 3 (22 Jan 2008) Today, 1 st homework will be uploaded at our class website. Seung-Jong Park (Jay) Computer Architecture (CSC-3501) Lecture 3 (22 Jan 2008) Seung-Jong Park (Jay) http://www.csc.lsu.edu/~sjpark 1 Announcement Today, 1 st homework will be uploaded at our class website Due date is the beginning

More information

Level ISA3: Information Representation

Level ISA3: Information Representation Level ISA3: Information Representation 1 Information as electrical current At the lowest level, each storage unit in a computer s memory is equipped to contain either a high or low voltage signal Each

More information

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations.

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations. Signed Binary Arithmetic In the real world of mathematics, computers must represent both positive and negative binary numbers. For example, even when dealing with positive arguments, mathematical operations

More information

Chapter 2. Data Representation in Computer Systems

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

More information

CHAPTER 2 (b) : AND CODES

CHAPTER 2 (b) : AND CODES DKT 122 / 3 DIGITAL SYSTEMS 1 CHAPTER 2 (b) : NUMBER SYSTEMS OPERATION AND CODES m.rizal@unimap.edu.my sitizarina@unimap.edu.my DECIMAL VALUE OF SIGNED NUMBERS SIGN-MAGNITUDE: Decimal values of +ve & -ve

More information

Memory Addressing, Binary, and Hexadecimal Review

Memory Addressing, Binary, and Hexadecimal Review C++ By A EXAMPLE Memory Addressing, Binary, and Hexadecimal Review You do not have to understand the concepts in this appendix to become well-versed in C++. You can master C++, however, only if you spend

More information

The Gray Code. Script

The Gray Code. Script Course: B.Sc. Applied Physical Science (Computer Science) Year & Sem.: IInd Year, Sem - IIIrd Subject: Computer Science Paper No.: IX Paper Title: Computer System Architecture Lecture No.: 9 Lecture Title:

More information

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur 1 Number Representation 2 1 Topics to be Discussed How are numeric data items actually

More information

LOGIC CIRCUITS. Kirti P_Didital Design 1

LOGIC CIRCUITS. Kirti P_Didital Design 1 LOGIC CIRCUITS Kirti P_Didital Design 1 Introduction The digital system consists of two types of circuits, namely (i) Combinational circuits and (ii) Sequential circuit A combinational circuit consists

More information

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

UNIT-II. Part-2: CENTRAL PROCESSING UNIT Page1 UNIT-II Part-2: CENTRAL PROCESSING UNIT Stack Organization Instruction Formats Addressing Modes Data Transfer And Manipulation Program Control Reduced Instruction Set Computer (RISC) Introduction:

More information

Fundamentals of Programming (C)

Fundamentals of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamentals of Programming (C) Group 8 Lecturer: Vahid Khodabakhshi Lecture Number Systems Department of Computer Engineering Outline Numeral Systems

More information

CHAPTER 2 Data Representation in Computer Systems

CHAPTER 2 Data Representation in Computer Systems CHAPTER 2 Data Representation in Computer Systems 2.1 Introduction 37 2.2 Positional Numbering Systems 38 2.3 Decimal to Binary Conversions 38 2.3.1 Converting Unsigned Whole Numbers 39 2.3.2 Converting

More information

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

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds. 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

More information

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B)

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B) Computer Arithmetic Data is manipulated by using the arithmetic instructions in digital computers. Data is manipulated to produce results necessary to give solution for the computation problems. The Addition,

More information

CHAPTER 2 Data Representation in Computer Systems

CHAPTER 2 Data Representation in Computer Systems CHAPTER 2 Data Representation in Computer Systems 2.1 Introduction 37 2.2 Positional Numbering Systems 38 2.3 Decimal to Binary Conversions 38 2.3.1 Converting Unsigned Whole Numbers 39 2.3.2 Converting

More information