








































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









































CS 231 - Computer Architecture I
-^ Number Systems^ –^
-^ Boolean Operations^ –^
-^ Circuit Analysis •^ Truth Tables •^ Boolean Algebra^ –^
deMorgans Laws
-^ Maxterms/Minterms
CS 231 - Computer Architecture I
-^ To get started, we’ll discuss one of the fundamental conceptsunderlying digital computer design:
-^ Computers use voltages to represent information. In modern CPUs thevoltage is usually limited to 1.6-1.8V to minimize power consumption. •^ It’s convenient for us to translate these analogvoltages into the discrete, or digital, values 1 and 0. •^ But how can two lousy digits be useful for anything?^ –^
Volts1.8 1 0 0
CS 231 - Computer Architecture I
-^ 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 theweights like this: •^ To find the decimal value of a number, multiply each digit by its weightand sum the products.
Digits
Weights
Digits
Weights
(^2) ( 1 x 10 ) + (^6 x 10
1 ) + (^2 x 10
0 ) + (^3 x 10
-1) + (^7 x 10
-2) + (^5
-3x 10) =
CS 231 - Computer Architecture I
-^ To convert a decimal integer into binary, keep dividing by 2 until thequotient is 0. Collect the remainders in
order.
-^ To convert a fraction, keep multiplying the fractional part by 2 until itbecomes 0. Collect the integer parts in forward order. •^ Example: 162.375: •^ So, 162.
rem^0 81 / 2^
rem^1 40 / 2 = 20
rem^
rem^
rem^0 5 / 2 = 2
rem
rem
rem
0.375 x 2 =
0.750 x 2 =
0.500 x 2 =
Converting Binary to Decimal^ 100110.
Converting Decimal to Binary^ 201.
Converting Decimal to Binary^ 244.
CS 231 - Computer Architecture I
-^ Converting from hexadecimal to binary is easy: just replace each hexdigit with its equivalent 4-bit binary sequence. •^ To convert from binary to hex, make groups of 4 bits, starting from thebinary point. Add 0s to the ends of the number if needed. Then, justconvert each bit group to its corresponding hex digit.
2
(^161111) F (^1011) B (^01117) (^00113)
(^1110) E (^1010) A (^01106) (^00102)
(^1101) D (^10019) (^01015) (^00011)
(^1100) C (^10008) (^01004) (^00000)
BinaryHex BinaryHex BinaryHex BinaryHex
Converting Hexadecimal to Binary^ F2A8.
CS 231 - Computer Architecture I
-^ Earlier, we used electrical voltages to representtwo discrete values 1 and 0, from which
binary numbers
values,
true^ and
false.
-^ For simplicity, we often still write digits instead:^ –^
-^ We will use this interpretation along with special operations to designfunctions and hardware for doing arbitrary computations.
Volts1.8^0 True False
CS 231 - Computer Architecture I
-^ Computers take inputs and produce outputs, just like functions in math! •^ Mathematical functions can be expressed in two ways: •^ We can represent logical functions in two analogous ways too:^ –^
A finite, but non-unique
Boolean expression
-^ A^ truth table
, which will turn out to be unique
An^ expression f(x,y) = 2x + y= x + x + y= 2(x + y/2)= ...
is finite but not unique
A^ function table
is unique but infinite
CS 231 - Computer Architecture I
-^ We can use these basic operations to form more complex expressions:
f(x,y,z) = (x + y’)z + x’
-^ Some terminology and notation:^ –^
are the
input variables
, each representing 1 or 0. Listing the
is any occurrence of an input variable or its complement. The function above has four literals:
x,^ y’,^ z
, and^ x’
-^ Precedences are important, but not too difficult.^ –^
f(x,y,z) = (((x +(y’))z) + x’)
CS 231 - Computer Architecture I
-^ A^ truth table
shows all possible inputs and outputs of a function.
-^ Remember that each input variable represents either 1 or 0.^ –^
n^ possible combinations of inputs.
-^ Inputs are listed in binary order—in this example, from 000 to 111.
x^ y^
z^ f(x,y,z) 0 0
0 1 0 0
1 1 0 1
0 1 0 1
1 1 1 0
0 0 1 0
1 1 1 1
0 0 1 1
1 1
f(0,0,0) = (0 + 1)0 + 1
= 1 f(0,0,1)
= (0 + 1)1 + 1
= 1 f(0,1,0)
= (0 + 0)0 + 1 = 1 f(0,1,1)^
= (0 + 0)1 + 1
= 1 f(1,0,0)
= (1 + 1)0 + 0
= 0 f(1,0,1)^
= (1 + 1)1 + 0
= 1 f(1,1,0)^
= (1 + 0)0 + 0 = 0 f(1,1,1)^
= (1 + 0)1 + 0
= 1 f(x,y,z) = (x + y’)z + x’