CL-Class 2-slides.pdf - CL=CSCI 160 CLASS 2 HW...

This preview shows 1 out of 5 pages.

CL=CSCI 160 CLASS 2
Image of page 1

Subscribe to view the full document.

HW 1.1 (Remainder method-fractions)-Solution + Binary-to Hex conversion justification Remainder Method – Fractions Let’s use 4-bit precision. This works for all bases! Ex.: 0.627 in base 10. What should we do? .627 * 2 = 1.254 .254 * 2 = 0.508 .508 * 2 = 1.016 .016 * 2 = 0. . . . 0. 1 0 1 0 Solution: Multiply only the fraction part by 2 and record the integer part (which will either be 1 or 0). Repeat until you reach the desired precision:
Image of page 2
Conversion from base 2 <––––> base 16 Justification 379 10 = 2 8 + 2 6 + 2 5 + 2 4 + 2 3 + 2 1 + 2 0 1 0 1 1 1 1 0 1 1 (2 4 ) 2 + (2 4 ) 1 (2 2 + 2 1 + 2 0 ) + (2 4 ) 0 (2 3 + 2 1 + 2 0 ) 16 2 16 1 16 0 7 11 = B = 1 7 B hex 1 = Now remember: 16 = 2 4
Image of page 3

Subscribe to view the full document.

HW 2.2 (Binary & Hex addition and subtraction)-Solution M = 3892.74 10 N = 9341.65 10 + 1 0 0 1 0 0 0 1 1 1 1 1 0 1 . 1 0 1 0 0 1 1 1 0 0 1 1 1 0 1 1 0 0 1 0 . 0 1 1 0 0 0 0 0 0 0 0 0 Subtraction: Addition: Decimal: 1324 - 999 5 2 3 Binary: 1 0 0 1 0 0 0 1 1 1 1 1 0 1. 1 0 1 0 0 1 - 1 1 1 1 0 0 1 1 0 1 0 0. 1 0 1 1 1 1 1 1 1 1 1 111 1 0 0 00 0 00 0 0 . 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 1 0 0 . 1 0 1 1 1 1 0 Binary: Next will be Hexadecimal. Let’s prepare for the grouping:
Image of page 4
Image of page 5
You've reached the end of this preview.
  • Spring '14
  • Zamfirescu,Christina
  • Binary numeral system, Positional notation, Decimal, 4-bit, 5 bits

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern