lecture4(number systems & binary logic)

Upload: usman3686

Post on 06-Oct-2015

229 views

Category:

Documents


0 download

DESCRIPTION

Lecture 4

TRANSCRIPT

  • Computer Fundamentals Lecture # 4:Number systems and Logical Operations

  • Todays Aim

    Learning about the different Numbering SystemsLearning Conversion Techniques among the different Number SystemsStudying the Important Logical Operations

  • Numbers:

    Number SenseCounting

  • History of Number Systems:

    Quipu of the Inca UmpireFractions in Ancient EgyptThe Mayan Number SystemThe Egyptian Number SystemThe Greek Number SystemThe Babylonian Number System

  • Main Numbering Systems:

    Decimal BinaryHexadecimal

  • Decimal Number System:

    Base-10 systemTen symbols to represent any number0,1,2,3,4,5,6,7,8,9Positional Number SystemEvery place has its own weightExamples:123.64 = 1*102 + 2*101 + 3*100 + 6*10-1 + 4*10-20.456 = 4*10-1 + 5*10-2 + 6*10-3

  • Binary Number System:Base-2 systemTwo symbols0,1Examples:1011001Used in all Digital DevicesWhy?

  • Hexadecimal Number System:Base-16 Number SystemSixteen symbols 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,Fcompact representation of binary numbers. How?Grouping

  • Conversion:Binary to Decimal:

    10112 = 1* 20 + 1* 21 + 0* 22 + 1* 23 = 1+2+0+8 = 11

    Decimal to Binary:510 = 1012

    5221201--

  • Conversion (continued):Hexadecimal to decimal:DEAD16 = ?

    Decimal to hexadecimal:20710 = ?

  • Data Organization:Bits (Binary Digits)

    Nibbles = 4 bits

    Bytes = 8 bits

    Word = 16 bits or more

  • Logical OperationsBoolean expression Results has two statestrue or false, represented by a 1 or a 0Three basic Boolean expressions:ANDORNOTLogic operations (derivative of the three)NAND, NOR, XOR etc.

  • Logical OperationsANDOut put is true for all inputs are trueTwo or more inputs only one outputOROutput is true for any input is trueTwo or more inputsonly one outputNOTOutput is NOT of the inputSingle inputsingle output

  • Logical OperationsTruth tableAll possible input combinations and outputsFor n number of inputs 2n entries of a truth tableBoolean expressionConsists of Boolean variablesAlternate representation of input-output relationship

  • Logical OperationsLogical Diagram (circuit)Symbolic representation of logic circuitsInputs and outputs have two values \0 or 1

  • Logic AND:Truth TablexyLogical DiagramBoolean Equationz

    xyz000010100111

  • Logic OR:Truth TableLogical DiagramBoolean Equationxyz

    xyz000011101111

  • Logical NOT:xyLogical DiagramTruth TableBoolean Equation

    xy0110

  • Logic NAND:Truth TableLogical DiagramBoolean Equationxyz

    xyz001011101110

  • Logic NOR:Truth TableLogical DiagramBoolean Equationxyz

    xyz001010100110

  • Logic XOR:Truth TableLogical DiagramBoolean Equationxzy

    xyz000011101110

  • Logic XNOR:Truth TableLogical DiagramBoolean Equationxyzz = x y

    xyz001010100111

  • Today we Learnt:About Number Systems

    Conversion among different number systems

    Binary Logic

    *An experiment done with a goldfinch showed the ability to distinguish piles of seed: three from one, three from two, four from two, four from three, and six from three. The goldfinch almost always confused five and four, seven and five, eight and six, and ten and six. Then there are examples of crows and wasps, humans only have a number sense of up to 4 objects.*Quiou camayocs,people who kept the record of the who, where and when of all the data stored ona quipu. It worked like this, there was this cord onto which thinner ropes or threads were tied. Onto each thinner rope was tied different coloured threads or strings, the closer to the thick cord, the higher the value.Ancient Egyptians had an understanding of fractions, however they did not write simple fractions as 3/5 or 4/9 because of restrictions in notation. The Egyptian scribe wrote fractions with the numerator of 1. They used the hieroglyph "an open mouth" above the number to indicate its reciprocal. The number 5, written , as a fraction 1/5 would be written . There are some exceptions. There was a special hieroglyph for 2/3, , and some evidence that 3/4 also had a special hieroglyph. All other fractions were written as the sum of unit fractions. For example 3/8 was written as 1/4 + 1/8. they formed tables for fraction calculations similar to that for integers.The base 20 and number 5, the first five place values were based on the multiples of 20, mayans invented zero to represent completion, symbols represent they might have used abacus, For further study: The 360 day calendar also came from the Mayan's who actually used base 18 when dealing with the calendar. Each month contained 20 days with 18 months to a year. This left five days at the end of the year which was a month in itself that was filled with danger and bad luck. In this way, the Mayans had invented the 365 day calendar which revolved around the solar system.

    the Egyptians used base 10, did addition, multiplication, division,Attic symbols for Greeks, then their alphabet system which was also used for numbers.The formed tables for the triples of the pythogorian equations, they used the base 60 system, hence the format of time, they didnt have a symbol for 0 but used the idea of zero, just represented it with a blank.The hindu Number system used today.