Unformatted text preview:

CS231: Computer Architecture ILaxmikant KaleFall 2003Introduction to CS2311Course Objectives• To learn how to design digital (i.e. boolean) circuits • To Understand how a simple computer works– Its hardware components – What they are built from– How to design them– Also, how to design digital circuits other than computers• Today– A grand overview– How have we been able to make a “Machine” that can do complex things• Add and multiply really fast • Weather forecast, design of medicinal drugs• Speech recognition, Robotics, Artificial Intelligence..• Web browsers, internet communication protocols• Starting at (almost) the lowest level– Gates to GatesIntroduction to CS2312The Modest Switch• All these capabilities are built from an extremely simple component:– A controllable switch• The usual Electrical switch we use every day– The electric switch we use turns current on and off– But we need to turn it on and off by hand– The result of turning the switch on?• The “top end” in the figure becomes• raised to a high voltage• Which makes the current flow through the bulb•The Controllable Switch• No hands•Voltage controls if the switch is on or off•High voltage at input: switch on •Otherwise it is offIntroduction to CS2313Using the switchOutputInput Output is high (voltage) if and only if the input is highNow we can make one circuit control another switch…Neat!This is getting boring..Introduction to CS2314Lets use them creativelyOutput is high if both the inputs input1 AND input2 are highIf either of the inputs is low, the output is low.Input1Input2OutputThis is called an AND gateNow, can you make an OR gate with switches?Introduction to CS2315OR GateInput1Input2OutputOutput is low iff both inputs are lowI.e. Output is high if either of the inputs (or both) are high (input1 OR input2)Introduction to CS2316Basic Gates • There are three basic kinds of logic gatesANDof two inputsOR of two inputsNOT(complement)on one inputOperation:Logic gate:•Two Questions:•How can we implement such switches?•What can we build with Gates? And How?Introduction to CS2317How to make switches?• Use mechanical power• Use hydrolic pressure• Use electromechanical switches (electromagnet turns the switch on)• Current technology:– Semiconductor transistors• A transitor can be made to conduct electricity depending on the input on the 3rdinput– CMOS “gates” (actually, switches)• We can now manufacture millions of transistors on a single silicon chip!Two properties of Switches and Gates:SizeSwitching and Propagation delaySo, switches and Gates are no magic.We believe they can be builtIntroduction to CS2318A little bit about technology• Two properties of Switches and Gates:– Size– Switching and propagation delay• Smaller the size, smaller the propagation delay (typically)!• Smaller the size, cheaper the processor!– Silicon is sand anyway– But you can put more logic on a single chip• This nice positive feedback cycle has– Made processors faster and cheaper– Over the last 30 years! (1972: Intel 4004)• Before that: A processor was built with MANY chipsIntroduction to CS2319What can we do with Gates?• What do you want to do?• Let us say we want to add numbers automatically• What are numbers? How are they represented– Roman XVII– Decimal: 17• How to add them, depends on how they are represented– One representation may be better than other for adding• Try adding two long roman numbers– Decimal is better but• We have only two “values”, high and low, in our gates– So, • Let us think about why decimal is better• And can we design a representation that allows us to use the binary (hi/low) gates that we have.Introduction to CS23110Decimal review• Numbers consist of a bunch of digits, each with a weight• These weights are all powers of the base, which is 10. We can rewrite this:• To find the decimal value of a number, multiply each digit by its weight and sum the products. 1 6 2 . 3 7 5 Digits100 10 1 1/10 1/1001/1000Weights1 6 2 . 3 7 5 Digits10210110010-110-210-3Weights(1 x 102) + (6 x 101) + (2 x 100) + (3 x 10-1) + (7 x 10-2) + (5 x 10-3) = 162.375Now we can see why addition is easier with decimal system than the roman system. The idea of positional weights and carry!Introduction to CS23111Nothing special about 10!• Decimal system (and the idea of “0”) was invented in India around 100-500AD• Why did they use 10? Anything special about it?– Not really.– Probably the fact that we have 10 fingers influenced this• Will a base other than 10 work?– Sure: 345 in base 9 = 5 +9*4 + 92*3 = 284 in base 10• Base 9 has only 9 symbols: 1, 2, 3, 4, 5, 6, 7, 8, 0– What about base 2? (1 and 0)• 1101 in base 2: 1 + 2*0 + 4*1 + 8*1 = 13• Base 2 system will work for our gates!– Base 2 Addition:– Compare this with decimal addition100110110011001+Introduction to CS23112Converting binary to decimal• We can use the same trick to convert binary, or base 2, numbers to decimal. This time, the weights are powers of 2.– Example: 1101.01 in binary– The decimal value is:1 1 0 1 . 0 1 Binary digits, or bits232221202-12-2Weights (in base 10)(1 x 23) + (1 x 22) + (0 x 21) + (1 x 20) + (0 x 2-1) + (1 x 2-2) = 8 + 4 + 0 + 1 + 0 + 0.25 = 13.25Powers of 2: Useful abbreviations:20 = 1 24 = 16 28 = 256 K = 210 = 1,02421 = 2 25 = 32 29 = 512 M = 220 = 1,048,57622 = 4 26 = 64 210 = 1024 G = 230 = 1,073,741,82423 = 8 27 = 128Introduction to CS23113Binary addition example worked out• Some terms are given here• Exercise: what are these numbers equivalent to in decimal?1 1 1 0 (Carries)1 0 1 1 (Augend)+ 1 1 1 0 (Addend)1 1 0 0 1 (Sum)The initial carryin is implicitly 0most significantbit (MSB)least significantbit (LSB)Introduction to CS23114Doing addition with gates• Lets do simple stuff first:– Can we add two numbers each with just 1 bit?• Bit: binary digit– 0+0 = 0, 0+1 = 1 , 1+0 = 1, and 1+1 = ???• 2. But 2 is not a symbol.• 10 (just as 5 + 5 is 10 in decimal)• Result is 0 with 1 carried over to the next bit..– Whats 1 and 0? High and low voltage respectively.ResultCarryHalf adderIntroduction to CS23115Half adder: resultResultThis circuit is so common, that it has a name an symbol as a gate by itself: Exclusive ORExclusive OROutput is 1 iffexactly one of the 2 inputs is 1Introduction to CS23116Adding two bits• A half adder is used to add


View Full Document

U of I CS 231 - Lecture notes

Documents in this Course
Counters

Counters

23 pages

Latches

Latches

22 pages

Lecture

Lecture

33 pages

Lecture

Lecture

16 pages

Lecture

Lecture

4 pages

Datapaths

Datapaths

30 pages

Lecture

Lecture

6 pages

Registers

Registers

17 pages

Datapaths

Datapaths

28 pages

Decoders

Decoders

20 pages

Load more
Download Lecture notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?