{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

02-NumbersAndBooleanFuncs

# 02-NumbersAndBooleanFuncs - Number Systems and Boolean...

This preview shows pages 1–7. Sign up to view the full content.

CS231: Computer Architecture I Number Systems and Boolean functions María J. Garzarán Fall 2010

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Number Systems and Boolean Functions 1 Number systems To get started, we’ll discuss one of the fundamental concepts underlying digital computer design: Deep down inside, computers work with just 1s and 0s. Computers use voltages to represent information. In modern CPUs the voltage is usually limited to 1.6-1.8V to minimize power consumption. It’s convenient for us to translate these analog voltages into the discrete, or digital, values 1 and 0. But how can two lousy digits be useful for anything? we’ll introduce special operations for computing with 1s and 0s, by treating them as the logical values “true” and “false.” First, we’ll see how to represent numbers with just 1s and 0s. Then Volts 1.8 0 1 0
Number Systems and Boolean Functions 2 Today’s lecture Number systems Binary number representation How to convert between binary and decimal representations Octal and Hex representations Basic boolean operations AND, OR and NOT The idea of “Truth Table” Boolean functions and expressions Truth table for Boolean expressions

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Number Systems and Boolean Functions 3 Decimal review Numbers consist of a bunch of digits, each with a weight : The weights are all powers of the base, which is 10. We can rewrite the weights like this: To find the decimal value of a number, multiply each digit by its weight and sum the products. ( 1 x 10 2 ) + ( 6 x 10 1 ) + ( 2 x 10 0 ) + ( 3 x 10 -1 ) + ( 7 x 10 -2 ) + ( 5 x 10 -3 ) = 162.375
Number Systems and Boolean Functions 4 Converting binary to decimal We can use the same trick to convert binary , or base 2, numbers to decimal. The only difference is that the weights are powers of 2 . For example, here is 1101.01 in binary: The decimal value is: ( 1 x 2 3 ) + ( 1 x 2 2 ) + ( 0 x 2 1 ) + ( 1 x 2 0 ) + ( 0 x 2 -1 ) + ( 1 x 2 -2 ) = 8 + 4 + 0 + 1 + 0 + 0.25 = 13.25

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Number Systems and Boolean Functions 5 Converting decimal to binary To convert a decimal integer into binary, keep dividing by 2 until the quotient is 0. Collect the remainders in reverse order.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern