Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computer Design CMPT 150 Section: D100 9962 Ch. 1 Digital Computers and Information CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 1.

Similar presentations


Presentation on theme: "Introduction to Computer Design CMPT 150 Section: D100 9962 Ch. 1 Digital Computers and Information CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 1."— Presentation transcript:

1 Introduction to Computer Design CMPT 150 Section: D100 9962 Ch. 1 Digital Computers and Information CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 1 Characteristics of a Digital System is its manipulation of discrete elements into information. Digital Systems deal with signals having a finite number of discrete values. In electronic implementations, these discrete elements can be represented by voltage intervals. In Analog systems variables are measured over a continuous range of intervals.

2 Representation of discrete elements Discrete elements of information are represented in a digital system by physical quantities called signals. These signals use two discrete values and as a result are known to be binary. Example: High/Low True/False I/O CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 2 The set of values {0, 1} defines a "2-valued" or "binary" alphabet. A sequence of symbols from a given alphabet is called a codeword.

3 Comparison of numbers in different bases DecimalsBinaryOctalsHexadecimals 0000 1111 21022 31133 410044 510155 611066 711177 81000108 91001119 10101012A 11101113B 12110014C 13110115D 14111016E 15111117F CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 3

4 Changing from other number bases to decimal A n  1 r n  1 + A n  2 r n  2 + ……+ A 1 r 1 + A 0 r 0 + A  1 r  1 + A  2 r  2 +….+ A  m + 1 r  m + 1 + A  m r  m Each coefficient A i is one of the digits of given number system. The subscript value i gives the position of the coefficient and, hence, the weight r i by which the coefficient must be multiplied. (312.4) 5 = 3 x 5 2 + 1 x 5 1 + 2 x 5 0 + 4 x 5  1 = (82.8) 10 CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 4 Note: 2 10 = Kilo, 2 20 = Mega, 2 30 = Giga

5 Changing decimal integers to binary This procedure requires division of decimal integers by 2 and making a note of the remainder. The first remainder obtained is referred to as the Least Significant Digit (LSD) and the last integer is referred to as the Most Significant Digit (MSD). 226 213rem 0LSD 2 6rem 1 2 3rem 0 2 1rem 1 0 MSD CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 5

6 Changing the fractional part of decimals to binary If the fraction part is 0.375, then we multiply the fractional by 2 and record the integer part in each calculation. We continue to do this until we obtain a string of zeros as our fractional part or observe a repeating pattern. Note: The direction of LSD and MSD is reversed in the fractional multiplication. Integer Part 2  0.375 = 0.75 0MSD 2  0.750 = 1.50 1 2  0.500 = 1.0 1LSD 6 CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU

7 Arithmetical Operations +, ,  on Binary 1 0 1 1  1 0 1 1 0 1 1 0 0 0 0  1 0 1 1   1 1 0 1 1 1 1 0 1 1 0 + 1 0 1 1 1 1 0 1 1 0 1 CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 1 0 1 1 0  1 0 0 1 0 0 0 1 0 0 7

8 Base 2 Encodings An encoding is an assignment of codewords in one alphabet to each of the symbols in a second alphabet. In the design of electrical circuits it is desirable to use a binary alphabet to maximize the voltage interval that can be associated with each symbol in an "encoding" of characters by voltage levels. CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 8 Base 2 Encoding: Each integer is represented by its corresponding value in base 2. As the value of the integer gets larger, the number of bits required gets longer. Thus the codewords vary in length.

9 Binary Coded Decimal (BCD) In BCD each integer into binary, only the symbols 0 through 9 are represented by their corresponding base-2 equivalents. Each binary value is extended to four characters (bits) by adding leading 0’s to any binary value with fewer than four bits. The resulting codewords are: N U MCODEWORD 00000 10001 20010 30011 40100 50101 60110 70111 81000 91001 9 CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU The BCD representation of an unsigned integer is obtained by concatenating the corresponding binary codes together. For example: 9132 would be encoded as 1001 0001 0011 0010. NOTE: The message is actually 16 bits long. Spaces are not part of the encoding but are used to make clear each codeword in the message.

10 Gray Codes The codewords for consecutive integers differ in only one bit position. There are a number of possible solutions. One such solution is displayed in the table below. N U MCODEWORD 00000 10001 20011 30010 40110 50111 60101 70100 81100 91101 CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 10 The advantage of using Gray Codes is that the amount of switching is minimized and the reliability of the switching circuitry is improved.

11 Odd and Even Parity Coded information can have one of the two types of parity. For odd parity each word must have an odd number of 1’s. Likewise for even parity each word must have an even number of 1’s. In the table on the right BCD codes with even parity have been shown. The parity P is made 1 when there are an odd number of 1’s. PABCD 00000 10001 10010 00011 10100 00101 00110 10111 11000 01001 CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 11

12 Alphanumeric and ASCII Codes Alphanumeric Codes consists of the 26 letters of English Alphabets, the 10 decimal digits, and some special characters. See page 23-24 of text. The American Standard Code for Information Interchange (ASCII) is a 7-bit code. However, modern day computers manipulate an 8-bit quantity known as byte. See page 24-25 of text. CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 12


Download ppt "Introduction to Computer Design CMPT 150 Section: D100 9962 Ch. 1 Digital Computers and Information CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 1."

Similar presentations


Ads by Google