Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 111 – Aug. 27 Section 1.1 –Binary data and operations –Logic gates –Flip-flop –A binary shorthand: hexadecimal Commitment for next day: –Please read.

Similar presentations


Presentation on theme: "CS 111 – Aug. 27 Section 1.1 –Binary data and operations –Logic gates –Flip-flop –A binary shorthand: hexadecimal Commitment for next day: –Please read."— Presentation transcript:

1 CS 111 – Aug. 27 Section 1.1 –Binary data and operations –Logic gates –Flip-flop –A binary shorthand: hexadecimal Commitment for next day: –Please read sections 1.2 and 1.3

2 Binary All information inside computer is in binary Smallest unit of data is the bit Only the values 0 and 1 are used 0 means “false” or “off” or the number 0 1 means “true” or “on” or the number 1 Individual bit values can be manipulated with Boolean operations: “and”, “or”, “not”, etc. –In hardware, we implement these operations with logic gates.

3 Boolean examples AND –To graduate, you must have 128 credits and 2.0 GPA. OR –Classics scholarship requires 3 years of Latin or 3 years of Greek. XOR (“exclusive” or) –To go to Cincinnati, you can fly or drive. In other words, it doesn’t make sense to do both. –Do you want a 2-door or a 4-door car? NOT –If a statement is true, its negation is false, and vice versa.

4 Gates Basic building blocks of CPU’s circuitry. Usually 2 inputs. X and Y could be 0 or 1. Combining gates into a circuit: –The output of one gate becomes input to another. –This is how more useful operations are performed.

5 ‘AND’ and ‘OR’ AND XYans 111 100 010 000 OR XYans 111 101 011 000 Note: 0 AND (anything) = 0 1 OR (anything) = 1

6 XOR XOR basically says, “either but not both” The output is 1 if both inputs are different. XOR XYAns 110 101 011 000

7 NOR, NAND NOR gate –Negation of the OR –Same as feeding output of OR into a NOT gate. –Symbol for NOR gate is same as OR but with a loop on the end. NAND gate –Negation of the AND…. analogous to NOR. Interesting property: –NOR and NAND are universal gates. Any other boolean operation can be implemented by using several NAND’s or several NOR’s.

8 Flip-flop circuit Circuit that can “store” or remember a 1 bit value. Its own output is used as input to one of its gates. To change flip-flop’s value, set one of the inputs to 1. See diagrams on page 23.

9 Hexadecimal One bit is not enough to convey much information. A single word or numerical value requires several bits. –Ex. The word “cat” can be represented by this bit sequence: 011000110110000101110011 “Hex” is a shorthand for binary –Allows us to represent every 4 bits with just 1 symbol. –Ex. 24 bits of information= 6 hex characters. –The word hexadecimal means there are 16 possible symbols, so we use 0-9 and then a-f. See table on page 25.


Download ppt "CS 111 – Aug. 27 Section 1.1 –Binary data and operations –Logic gates –Flip-flop –A binary shorthand: hexadecimal Commitment for next day: –Please read."

Similar presentations


Ads by Google