Chapter 2

Ace your homework & exams now with Quizwiz!

Truth Table

# of lines for truth table = 2 to the power n. n=number different of variables. # of 0's/1's is half of the previous amount starting with half the total lines.

2's Complement

1's complement increased by 1. Steps: 1. Flip bits and add 1 to form negative numbers. - Positive numbers can be left alone - only need to complement negative numbers to get 2's complement form. To Subtract binary 2s compliment 1. compliment the bottom substractor by flipping and adding 1 2. then add the two signed numbers 3. leave the carry bit ie. pg 76 ex. 2.20

Number Range

Binary number with N bits can represent unsigned n integers from 0 - 2(power n) - 1. ie. 4bits range = 0-15 8 bits range = 0 - 255 Overflow - Occurs in unsigned binary representation when the result of an arthimetic operation is outside the range of allowed precision for the given number of bits. ie. 4 bit 1111(base 2) + 1111(base 2), 15+15 = 30 but base 4 range only goes to 15.

2.3 Converting Between Bases

Conversion of Unsigned Whole Numbers ( already in /from base 10) - Division Remainder or Subtraction method. Division Method - Divide number you want converted by the desired format (base). ie. "Convert 538in base 10 to base 8". Steps: 1. Draw upside down long division symbol with conversion base on outside and number to be converted on inside. 2. Divide the number as normal, record the result below, redraw long division symbol, and record remainder on far right side. -Note the value before the decimal -Subtract division value before the decimal, then multiply the value after decimal to the desired base to get remander. -record the remainder on the far right side. 3. Repeat until 0 4. Read remainder bottom to top to get final value after conversion. Convert to Base 10 It can be easier to convert to base 10 first (convert to decimal by Steps: 1. multiplying value in places by current base (with the power starting with 0 ) then add values together to get answer. power in first place is 0 2. Use division remainder method as usual with new deciaml value and desired base conversion.

Complement Systems

Diminished Radix complement of a number n in base r having d digits, the diminished radix complement of N is d defined to be (r - 1) - N. ie. for r =10 ,dimnished radix is 10-1 =9.

Signed Representation

First digit is allocated to represent the sign (+/1), digits after are the number. 3. Common Methods : 1. Signed Magintude - uses remaining bits to represent the magnitude of the number. In Signed Magintude Largest Value Range: n-1 n-1 N bits = ( 2 (power n -1)- 1) to (- 2(power n-1) - 1) , largest 127, smallest = -127 ie. 7 7 8bit :( 2 - 1) - (- 2 - 1) , largest 127, smallest = -127 Rules for Addition: 1. If the signs of the numbers are the same, add the magitudes and use that same sign for the results - convert from binary to decimal ,using normal place addition , then subtract to check answer. Remember not to include sign. 2. If the signs are different, must determine which operand has the higher magnitude. Sign of results is same as sign of operand with larger magnitude. And the magnitude must be determined by subtracting the smaller one from the larger one. - Dont use sign in addition, only include correct number of bits (ie. in in 8bit signed, use 7 bits) - if there is a carry, disard it and record it as an overlfow. Addition factor: 0+0 = 0 0+1 = 1 1+0 =1 1+1 = 0 with carry 1 1+1+1(carry) = 1, with carry 1

Bit

Most basic unit of information in a digital computer is called a bit. byte - 8 bits nipple - 4 bits Binary - base 2 (digits 0 & 1) Hexademical - base 16 (0 -9, A,B,C,D,E,F -represent numbers 10 -15) Octal - base 8 (0 -7) see table 2.1 (pg. 63 for chart

1's Complement

One's Complement - Value obtained by subtrating that number from a large power of 2 If a number is negative, convert it to its complement /FLIP 1/0'S, results should have 1 in left most positon. * ie. Express 23 base 10 in 8 bit binary using 1's complement. Steps; - Follow same rules for binary conversion. - Positive numbers can be left alone - only need to complement negative numbers INCLUDE Sign in addition - For negative numbers: take positive binary value of desired number, flip all 1's to0's and vice versa, value should start with 1 1. format = 8 bit, 1's and 0's Adding in one's complement - add nomrally after converting to binary when both postive, include sign in asnwer Substration: (add negative to positve number) 1. substrat as normal using addtion of 1 neg . method . ie 23+ -9 (remember to take negative binary value of positive in order to then add that to the positive) 2. ADD last carry to the sum of the two values for your final anwer. pg. 75 - if carry is 0, no need to add it Disadvantage: double 0 ; 00000000, 1111111111

2.3.2 Converting Fractions across bases

Steps : Demical method 1. Convert fraction to decimal 2. Same idea as Decimal remainder method 3. Instead of dividing, multiply desired base by decimal 4. record the result of value before the decimal and repeat 5. note the value decimal 6. Read value before decimal from top to bottom to get converted value. 7. write value to right of binary point (decimal. ie 0.xxxx)


Related study sets

Biology Chapter 2: Life's Chemical Basis

View Set

Biology 211 CRISPR/Cas9 Article Questions

View Set

Chapter 1 Exam 1 review-Structural Kinesiology

View Set

Chapter 36 Management of Patients with Musculoskeletal Disorders

View Set

Foundations In Business Final (Exam 3) TCU Ackall

View Set

STUDY NOTES FOR EXPLORING INNOVATION

View Set