Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unsigned Binary Encoding

Similar presentations


Presentation on theme: "Unsigned Binary Encoding"— Presentation transcript:

1 Unsigned Binary Encoding
DAT2343 Unsigned Binary Encoding Encoding unsigned binary values using binary circuits. © Alan T. Pinck / Algonquin College; 2003

2 The Most Common “Standard” Encoding System: Unsigned Binary
is used to represent: integer values greater than or equal to zero is used by almost every computer system as its basic numeric coding system Rather than invent our own encoding system each time we wish to represent a value, certain "standard" systems are normally used. One of the simplest of the "standard" systems is called Unsigned Binary Encoding. Unsigned binary encoding is used to represent integer values which are greater than or equal to zero (up to some maximum limit, which we will discuss in a minute).

3 Terminology bit binary digit (a binary circuit) As a terminology note:
Since each circuit is used to represent a "binary digit", it is more common to refer to these positions as "bits", short for "binary digit", than as circuits.

4 Positional Notation A 1 in any position represents a value which is one greater than the largest value that can be represented using on the digit positions to its right. Example: in the number 61543, the “1” represents one more than could be represented using the three positions to its right, that is one more than 999 A '1' in any position represents the value which is one greater than the largest possible value which can be represent using all the positions to the right of this position. In the example on this slide, there are 3 decimal digit positions to the right of the 1. The largest value that can be represented with 3 decimal digits is 999. The 1 represents 1000, one more than 999.

5 Position Identification
Example: An 8-circuit collection (where each of the boxes represents one circuit which could be either 0/off or 1/on). In binary we typically number the positions, Starting at the right, and numbering from zero. In this way the positions of an 8-circuit pattern would be numbered as 7, 6, 5, 4, 3, 2, 1, and 0 (reading from left to right).

6 Bit Position Weights If the bit in position 0 ("bit 0") is "on" (a 1) then it represents the value 1 or “has a weight of 1”. If bit 1 is "on" (a 1), it represents the value 2. If both bit 0 and bit 1 are "on", then the value represented is the combination of The weights for bits 0 and 1, that is a combination of 1 and 2, 3. If bit 2 is "on" (a 1), it represents the value (or has a “weight” of ) 4 4 being the first value that can not be represented using only bits 0 and 1. If bits 2, 1, and 0 are all "on", then the value represented is the combination of the weights 4 and 2 and 1, namely 7. If bit 3 is "on" (a 1), it represents the value 8; and so on. (For the mathematically inclined, you might also note that the weight of a position is 2 to the power of the position number).

7 Represented Value Based On Position Weights
(using an 8-bit/circuit example) Notice that each bit position can be though of as having a "weight" where this "weight" is added to the total value to be represented if (and only if) the circuit (bit) in that position is "on" (a 1). In the example pattern on this slide The bits in positions 5, 4, 2, and 0 are “on” With respective weights of 32, 16, 4, and 1 The value being represented is the sum of these weights, 53

8 “Words” the number of circuits (wires) used to represent a basic encoded number (normally unsigned binary) is “hard-wired” in a computer when it is built. the number of circuits used by a specific computer to represent its basic numeric form is called the “word size” of that computer. Unfortunately, in order to be able to manipulate numbers efficiently, in real-world digital computers, it is necessary to set the number of circuits used to represent the basic numeric form (that is, unsigned binary) to a fixed number at the time the computer is built. It is not (in general) possible to use fewer circuits (bits) sometimes when you only need small numbers and more circuits (bits) at other times when you need to represent large numbers. The number of circuits which are "hard-wired" into a computer to be used as for the basic numeric form of encoding Is the computer's "word size". Typically a computer might have a word size of 16 bits, 32 bits, 64 bits, or 128 bits, depending upon the particular computer.

9 “Words” (continued) the actual collection of circuits used to represent a number in its basic encoded form (for some specific computer) is called a “word”. note: in the terminology of computer architecture, a “word” relates to numbers, and not to what we normally mean by the term “word” in English. An actual collection of circuits used to represent a basic numeric value in some specific computer is called a “word”. Notice that this is a quite different meaning of the word: “word” than we would expect in normal English.

10 Limitations Imposed By Word-Size
A computer is limited in how large a number it can represent in its basic numeric coding system (usually unsigned binary). This limit is the value represented when all the circuits/bits of a “word” are turned “on”. Example: A computer using an 8-bit word would have a maximum value which it could represent (in unsigned binary) of: Notice that the word size of a computer limits the largest value which can be encoded using the basic numeric system (that is, unsigned binary). For example, if a particular computer had an 8-bit word, the largest unsigned binary value which could be encoded would be the sum of its bit weights: , 255 = 255

11 End of Lecture


Download ppt "Unsigned Binary Encoding"

Similar presentations


Ads by Google