EENG 2710 Chapter 1. Number Systems and Codes. Chapter 1 Homework. 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a. Number Systems. Binary Number System. Uses two digits, 0 and 1. Represents any number using the positional notation. Positional Notation.
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Binary Number System • Uses two digits, 0 and 1. • Represents any number using the positional notation.
Positional Notation • The value of a digit depends on its placement within a number. • In base 10, the positional values are (starting to the left of the decimal) –1 (100), 10 (101), 100 (102), 1000 (103), etc. • In base 2, the positional values are1 (20), 2 (21), 4 (22), 8 (23), etc.
Bit • Shorthand for binary digit, a logic 0 or 1. • The most significant bit (MSB) is the leftmost bit of a binary number. • The least significant bit (LSB) is the rightmost bit of a binary number.
Binary Inputs • Digital circuits operate by accepting logic levels (0,1) at their input(s). • The corresponding output(s) logic level will change (0,1).
Sum Powers of 2(Decimal to Binary) • Step 1: • Determine the largest power of 2 less than or equal to the number to be converted. • Place a 1 in that positional location. • Convert 5710 to binary • 6410 5710 3210
Sum Powers of 2 • Step 2: • Subtract the number found in Step 1 from the number to be converted. • 57 – 32 = 25 • For the new number, determine if the next lowest power of 2 is less than or equal to that number. • 25 – 16 = 9
Sum Powers of 2 • Step 3: • If the new power of two from Step 2 is larger, place a 0 in that positional location. • If the new value is less than or equal, place a 1 in that positional location.
Sum Powers of 2 • Step 4: • Repeat Steps 2 and 3 until there is nothing left to subtract. • All remaining bits are set to 0. 5710 = 1110012
Fractional Binary Numbers • Radix point: • The generalized decimal point. The dividing line between positive and negative powers for positional multipliers. • Binary point: • The radix point for binary numbers.
Fractional Binary Values • The value immediately to the right of the binary point is 2–1 = 0.5. • The next value to the right is 2–2 = 0.25. • The next value to the right is 2–4 = 0.125, and so on.
Radix Method for 0.210 to Binary (Repeated Multiplication by 2) • Step 1:Multiply the decimal fraction by 2. • Step 2: Integer part is 0 or 1 left of decimal point. 0.2 x 2 = 0.4 Integer part = 0 0.4 x 2 = 0.8 Integer part = 0 0.8 x 2 = 1.6 Integer part = 1 0.6 x 2 = 1.2 Integer part = 1 0.2 x 2 = 0.4 Integer part = 0 (stop 0011repeats) Read integer parts from top to bottom Therefore, 0.210 = 0.0011 0011 0011
Hexadecimal Numbers • Base 16 number system. • Primarily used as a shorthand form of binary numbers.
Counting in Hexadecimal • Values range from 0 to F with the letters A to F used to represent the values 10 to 15 respectively. • Positional multipliers are powers of 16:160 = 1, 161 = 16, 162 = 256, etc.
Signed/Unsigned Binary Numbers • Signed Binary Number: • A binary number of fixed length whose sign (+/–) is represented by one bit (usually MSB) and its magnitude by the remaining bits. • Unsigned Binary Number: • A binary number of fixed length whose sign is not specified by a bit. All bits are magnitude and the sign is assumed +.
Unsigned Binary Arithmetic • Sum: • Result of an Addition Operation of two (or more) binary numbers (operands). • Carry: • A digit (or bit) that is carried over to the next most significant bit during an n-Bit addition operation. • The carry bit is a 1 if the result was too large to be expressed in n bits.
Basic Subtraction • Basic Subtraction of x = a–b, with a = minuend, b = subtrahend, and x = difference or result. • Requires a Borrow Bit if a < b. • There are other forms of subtraction such as 2’s Complement Addition used by microprocessors (such as in a PC).
Signed Binary Numbers • Sign Bit: • A bit (usually the MSB) that indicates whether a number is positive (= 0) or negative (= 1). • Magnitude Bits: • The bits of a signed binary number that tell how large it is in value.
Signed Binary Numbers • True-Magnitude Form: • A form of signed binary whose magnitude bits are the TRUE binary form (not complements). • 1’s Complement: • A form of signed binary in which negative numbers are created by complementing all bits. • 2’s Complement: • A form of signed binary in which the negative numbers are created by complementing all the bits and adding a 1 (1’s Complement + 1).
True-Magnitude Form • 5-Bit Numbers Negative Sign (S = 1) • +25 = 011001 (Note sign bit (MSB) Sign = 0) • –25 = 111001 (Same as +25 with sign = 1) • +12 = 001100 • –12 = 101100
Negative Results • If the True-Magnitude Form is used for subtraction, the results are incorrect. • If the result is from 1’s or 2’s Complement and the result is negative (S = 1), the magnitude is found by taking the complement of the result.
Range of Signed Numbers • Range of Positive Numbers is 0 to 2n– 1 for a number with n magnitude bits. • Range of Negative Numbers is –1 to –2n for a number with n magnitude bits. • 8-Bit Example: 8-Bit Number Range is –2n x +2n – 1 or –128 to +127
Connexion au compte
Connectez-vous pour publier votre contenu sur SlideServe.