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. To convert a fraction, keep multiplying the fractional part by 2 until it
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/19/2011 for the course CS 231 taught by Professor - during the Spring '08 term at University of Illinois at Urbana–Champaign.

### Page1 / 20

02-NumbersAndBooleanFuncs - Number Systems and Boolean...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online