Lecture3 en Number Repr Boolean 2014(1)

download Lecture3 en Number Repr Boolean 2014(1)

of 57

Transcript of Lecture3 en Number Repr Boolean 2014(1)

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    1/57

    Representation of numbers incomputers. Logical

    foundations. Boolean algebra,

    Boolean variables, functions,

    basic relationshipsBit, byte and machine word. Sign-and-magnitude, ones'

    complement and two's complement. Integers and floatingpoint numbers. Symbol information in computer systems.

    Introduction in Boolean algebra. Operations and laws.Boolean expressions, Conjunction, disjunction, negation,

    implication, exclusive or, logical equivalence. De Morganslaws. Converting logical expressions

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    2/57

    Bit

    A bitis the basic unit for information used in computersand communications. Bit can be defined as a variable orcomputed quantity that can have only twopossible valuesi.e. a binary digit which represents

    either 1 or 0 (one or zero). The language of the computer is a set (sequence) of

    binary digits (bits). The computers simply executecommands, called instructions, given by theprogrammers. An instruction is simply a sequence of

    bits, which the computer interprets in a certain way. Forexample the bits 1000110010100000 instruct certaintypes of processors to add 2 numbers

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    3/57

    Byte 8 bits = 1 byte A byte is a unit of digital information in computing and

    telecommunications that most commonly consists ofeight bits

    From a historical prospective, a byte was the number of

    bits used to encode a single character of text in acomputer. So it was and still is thebasic addressable element in most computerarchitectures

    The size of the byte was hardware dependent, so therewas no standards to define its size. Eight bits were veryconvenient to code values between 0 and 255 in onebyte

    The term octet was defined to explicitly denote asequence of 8 bits because of the ambiguity associatedin the past with the term byte

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    4/57

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    5/57

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    6/57

    Coding byte values

    byte = 8 bits

    binary 000000002 to111111112 decimal: 0

    10

    to25510 hexadecimal 0016 toFF16

    - For hexadecimal numbers

    - use digits 0 to 9 and A to F

    - present as FA1D37B16 in C language as0xFA1D37B

    >> or 0xfa1d37b

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    7/57

    Machine word

    A machine word is the the natural unit of dataused by a particular processor design. It is apredefined group of bits that are handeled as aunit byt the instruction set. The number of bits in

    a word (the word size, word width, or wordlength) is an important characteristic of a specificprocessor design or computer architecture

    In modern computers, the typical group is 32 bits(the first computers had 4 or 8 bits, some of thenewest64 and 128 bits), and is the number ofbits in most registers of the architecture (e.g. theMIPS architecture)

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    8/57

    Byte Ordering

    Issue - how should bytes be ordered inmemory within multi-byte word

    Conventions Alphas, PCs are Little Endian machines

    - Least significant byte has lowest address Suns Macs are Big Endian machines

    - Least significant byte has highest address

    Example

    Variable x has 4-byte representation 0x01234567 Address given by &x is 0x100

    0x100 0x101 0x102 0x103

    4523 67

    Big Endian

    0x100 0x101 0x102 0x103

    2345 01Little Endian

    01

    67

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    9/57

    Representing Integersint A = 15213;

    int B = -15213;Long int C = 15213;

    Decimal: 15213

    Binary: 0011 1011 0110 1101Hex: 3 B 6 D

    6D3B

    00

    00

    0000

    3B

    6D

    93

    C4

    FF

    FF

    FF

    FF

    C4

    93

    6D3B

    00

    00

    6D3B

    00

    00

    00

    00

    00

    00

    0000

    3B

    6D

    Linux/Alpha A Sun A Linux C Alpha C Sun C

    Linux/Alpha B Sun B

    Twos complement representation

    (Covered later in the lecture)

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    10/57

    Bi-endian architectures

    Some architectures (incl. ARM, PowerPC, Alpha,SPARC V9, MIPS, PA-RISC and IA-64) can change theendianness in data segments, code segments or both.Such feature can improve the performance and simplifythe logic of network devices and software. The term bi-

    endian, when used for hardware, denotes the possibilityof the machine to compute or transfer data in any of thetwo formats

    Many of these architectures can switch through softwareto one or another endian format by default (usually this is

    done upon the start of the computer) but for somesystems, the default format can be chosen by thehardware on the main board and can not be changed bythe software

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    11/57

    Bi-endian architectures

    The term "bi-endian" refers to the way theprocessor treats access to data.Instruction accesses (fetches of instruction

    words) on a given processor may stillassume a fixed endianness, evenif dataaccesses are fully bi-endian, though

    this is not always the case, such as onIntel's IA-64-based Itanium CPU, whichallows both

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    12/57

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    13/57

    Endianness and operation systems

    Operation systems with Big-endian AIX on POWER AmigaOS on PowerPC and 680x0 FreeBSD on PowerPC and SPARC HP-UX on Itanium and PA-RISC Linux on MIPS, SPARC, PA-RISC, POWER, PowerPC, 680x0,

    ESA/390, z/Architecture, H8, FR-V, AVR32, Microblaze,ARMEB, M32R, SHEB and Xtensa.

    Mac OS on PowerPC and 680x0 Mac OS X on PowerPC

    NetBSD on PowerPC, SPARC, and etc. OpenBSD on PowerPC, SPARC, and etc. MVS and DOS/VSE on ESA/390, and z/VSE and z/OS on

    z/Architecture Solaris on SPARC

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    14/57

    Representation of numbers

    People use the decimal number system, whichfor the computers, the most convenient to use isthe binary system.

    The hardware can be designed to add, subtract,

    multiply and divide binary numbers The computer programs must be able to work

    with both positive and negative numbers Computer programs must also recognize an

    event, when an operation ends with a number,bigger than the biggest possible number in thecomputer

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    15/57

    Representation of numbers

    In binary system/numbers we can not use aminus sign (-) to represent negative numbers We would like to represent binary numbers with

    only two symbols, 0 and 1, are allowed fornumber representation

    The easiest solution is to have a bit for positiveand negative numbers

    Where should the bit reside? (left or right). Theadders will need one more operation for this bit,

    as they can not know in advance what the resultwill be (whether positive or negative) and inadditionthere will be a positive 0 and anegative 0, which can be a problem

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    16/57

    Sign-and-magnitude, ones'complement and two's complement

    Sign-and-magnitudepositive:

    0 -1... 10 (0000 1010) = ?

    negative

    1 -1... 10 (1000 1011) = ?

    Ones' complementpositive:

    0 -1... 10 (0000 1100) = ?

    negative

    1 (1111 0101) = ?011

    ,..., xxxxkk

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    17/57

    Sign-and-magnitude, ones'complement and two's complement

    Two's complementpositive: 0

    -1... 10 (0000 1001) = ?

    Negative

    1 (1111 0100) = ?

    00000000= 00000001=

    00000010=

    01111111=

    10000000=

    10000001= 10000010=

    11111110=

    11111111=

    1,...,011

    xxxxkk

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    18/57

    Two's complement

    10000000 is not in use, as it has nocorresponding positive number

    Modern computers use the twos compliment

    representation as it requires least additionalinterventionsthe simplicity of this code is that itdoes not have two 0s, as do the sign andmagnitute and the ones complement

    All negative numbers for the twos complementcode start with 1 in the most significant bitthehardware checks this bit to determine whetherthe number is positive or negative

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    19/57

    Two's complement

    For the twos complement, an overflowcan occurwhen the sign bit is differentfrom the one that should be (0 for

    operations with positive numbers and 1 foroperations with negative numbers)

    When adding operands with differentsigns, overflow cannot occur. The reasonfor this is the sum must be no larger thanone of the operands

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    20/57

    Two's complement

    The value of a two's-complement binarynumber can be calculated by adding upthe power-of-two weights of the "one" bits,

    but with a negative weight for the mostsignificant (sign) bit

    for example: 111110112= - 128 + 64 + 32

    + 16 + 8 + 0 + 2 + 1 = -5

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    21/57

    Two's complement

    sign Integer part

    + 37 0 0000000 00100101

    Two'scomplement

    1 1111111 11011010

    add +1 1

    - 37 1 1111111 11011011

    Operations are equivalent to:

    1 00000000 00000000

    0 00000000 00100101

    11111111 11011011

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    22/57

    Two's complement

    For operations in twos complement, additiondiffers from ordinary addition only by ignoringthe carry for the sign (watching for an overflow isdone separately)

    Subtraction is an addition, changing the sign bitof the second operand If the left two carry bits are both 1s or both 0s,

    the result is valid; if the left two carry bits are "1

    0" or "0 1", a sign overflow has occurred Conveniently, an XOR operation on these twobits can quickly determine if an overflowcondition exists

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    23/57

    Two's complement

    0 1001 + 0 0101 = 0 1110

    0 10010 0101 =

    0 1001 + 1 1011 = 10 0100 = 0 0100 1 0111 + 0 0101 = 1 1100

    0 1100 + 0 0101 = 1 0001 (?)

    The carry bit is ignored!

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    24/57

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    25/57

    Integers and floating point numbers

    An integeris a datum of integral data type-a finite subset of themathematical integers. Integral data types may be of different sizes andmay or may not be allowed to contain negative values. Integers arerepresented in a computer as a group of binary digits. The place ofdecimal/binary point is fixed. The set of integer sizes available variesbetween different types of computers. The hardware for operations with

    integers is simpler and less expensive than for floating point numbers. Floating point numbersignificant digits, or fraction (M1), base (p) and

    exponent (E1)

    The advantage of floating-point representation over fixed-point and integer representation is that it can support a much widerrange of values

    The floating-point format needs slightly more storage (to encode theposition of the radix point), so when stored in the same space, floating-point numbers achieve their greater range at the expense of precision.

    1*1

    EpMN

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    26/57

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    27/57

    Floating point operations

    A simple method to add floating-point numbersis to first represent them with the same exponent

    The significand of the number with lower

    exponent is shifted right by the absolute value ofthe difference of the exponents, the result willhave the bigger exponent, then the significantnumbers are added or subtracted as for integers

    123456.7 + 101.7654 = (1.234567 10

    5

    ) +(1.017654 102) = (1.234567 105) +(0.001017654 105) = (1.234567 +0.001017654) 105= 1.235584654 105

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    28/57

    Floating point operations

    To multiply, the significands are multiplied whilethe exponents are added, and the result isrounded and normalized

    Similarly, division is accomplished by subtractingthe divisor's exponent from the dividend'sexponent, and dividing the dividend's significandby the divisor's significand

    e=3; s=4.734612 x e=5; s=5.417242 ; e=8; s=25.648538980104 (true product)

    e=9; s=2.564854 (after normalization)

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    29/57

    Floating point standard

    Prior to the IEEE-754 standard, computers usedmany different forms of floating-point, differing inthe word sizes, the format of therepresentations, and the rounding behavior of

    operations. These differing systemsimplemented different parts of the arithmetic inhardware and software, with varying accuracy

    The IEEE-754 standard was created in the early1980s after word sizes of 32 bits (or 16 or 64)had been generally settled upon. This wasbased on a proposal from Intel who weredesigning the i8087 numerical coprocessor

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    30/57

    Floating point arithmetic

    Binary floating-point arithmetic is at its bestwhen it is simply being used to measure real-world quantities over a wide range of scales(such as the orbital period of a moon around

    Saturn or the mass of a proton), and at its worstwhen it is expected to model the interactions ofquantities expressed as decimal strings that areexpected to be exact

    An example of the latter case is financialcalculations. For this reason, financial softwaretends not to use a binary floating-pointnumber representation

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    31/57

    Strings In formal languages, which are used in mathematical

    logic and theoretical computer science, a stringis afinite sequence of symbols that are chosen from a set oralphabet

    In computer programming, a string is traditionally asequence of characters, either as a literal constant or as

    some kind of variable. The latter may allow its elementsto be mutated and/or the length changed, or it may befixed (after creation)

    A string is generally understood as a data type and isoften implemented as a byte (or word) array that stores a

    sequence of elements, typically characters, using somecharacter encoding. A string may also denote moregeneral array data types and/or other sequential datatypes and structures; terms such as byte string, or moregeneral, string ofdatatype, or datatype-string, aresometimes used to denote strings in which the stored

    data does not (necessarily) represent text

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    32/57

    Strings in C

    Strings in C

    Represented by array of characters

    Each character encoded in ASCII format

    - Standard 7-bit encoding of character set - Other encodings exist, but uncommon

    - Character 0 has code 0x30

    Digit ihas code 0x30+i String should be null-terminated

    - Final character = 0

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    33/57

    String compatibility

    Compatibility

    Byte ordering not an issue

    - Data are single byte quantities

    Text files generally platform independent

    - Except for different conventions ofline termination character!

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    34/57

    String operations

    Two most often used operations areconcatenation and subset

    S=love

    T=you

    ST = loveyou (not commutative operationST ^=TS)

    Subset (loveyou), S=love

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    35/57

    Introduction in Boolean algebra

    Boolean algebra, as developed in 1854 by GeorgeBoole It is a variant of ordinary elementary algebradiffering in its values, operations, and laws. Instead ofthe usual algebra of numbers, Boolean algebra is the

    algebra of truth values 0 and 1, or equivalently ofsubsets of a given set. The operations are usually takento be conjunction, disjunction, and negation, withconstants 0 and 1. And the laws are definable as thoseequations that hold for all values of their variables, for

    examplex

    (y

    x) =x. Applications include mathematicallogic, digital logic, computer programming, set theory,and statistics

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    36/57

    Introduction in Boolean algebra

    Whereas elementary algebra deals mainly withreal numbers, Boolean algebra deals with thevalues 0 and 1. These can be thought of as two

    integers, or as the truth values falseand truerespectively. In either case they are called bits orbinary digits, in contrast to the decimal digits 0through 9

    Boolean algebra also deals with other values onwhich Boolean operations can be defined, suchas sets or sequences of bits

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    37/57

    Introduction in Boolean algebra

    In the 1930s, Claude Shannon observed thatone could also apply the rules of Boole's algebrafor switching circuits and introduced switchingalgebraas a way to analyze and design circuits

    by algebraic means in terms of logic gates Shannon already had at his disposal theabstract mathematical apparatus, thus he casthis switching algebra as the two-elementBoolean algebra. In circuit engineering settings

    today, there is little need to consider otherBoolean algebras, thus "switching algebra" and"Boolean algebra" are often usedinterchangeably

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    38/57

    Introduction in Boolean algebra

    Efficient implementation of Booleanfunctions is a fundamental problem in thedesign of combinatorial logic circuits

    Modern electronic design automation toolsfor VLSI circuits often rely on an efficientrepresentation of Boolean functions knownas (reduced ordered) binary decisiondiagrams (BDD) for logic synthesis andformal verification

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    39/57

    A Truth Table

    Developed in 1854 by George Boole. Further developed by Claude Shannon (Bell Labs).

    Outputs are computed for all possible input combinations(how many input combinations are there?).

    Consider a room with two light switches. How must theywork?

    SwitchA SwitchB

    GND

    Hot

    LightZ

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    40/57

    Basic operations

    Some operations of ordinary algebra likemultiplicationxy, additionx+y, and negation x,have their counterparts in Boolean algebra

    The corresponsing Boolean operations are AND,OR, and NOT, also calledconjunction

    xy, disjunctionxy, and negationorcomplement x, or sometimes !x

    Some use instead the same arithmeticoperations as ordinary algebra reinterpreted forBoolean algebra, treatingxyas synonymouswithxyandx+ywithxy

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    41/57

    Boolean expressions

    Duality principle:

    the duality principleis when we substitute

    AND with OR (or ORwith AND) and at thesame time substitute1s with 0s and 0s with1s

    Positive AND logic

    Negative OR logic

    A B F

    0

    0

    1

    1

    0

    1

    0

    1

    0

    0

    0

    1

    A B F

    1

    10

    0

    1

    01

    0

    1

    11

    0

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    42/57

    Gate logicpositive vs negative

    Positive logic: 1 is represented by high voltage;logic 0 is represented by low voltage.

    Negative logic: logic 0 is represented by high

    voltage; logic 1 is represented by low voltage. Normal Convention: Positive Logic/Active

    High

    Low Voltage = 0; High Voltage = 1

    Alternative Convention sometimes used:

    Negative Logic/Active Low

    /

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    43/57

    Positive/Negative Logic Assignments

    A B F

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    A B F

    1 1 1

    1 0 1

    0 1 1

    0 0 0

    A B F

    low low low

    low high low

    high low low

    high high high

    Voltage Levels Negative Logic LevelsPositive Logic Levels

    Physical

    AND gateAB

    FA

    B F = A B F = A + BA

    B

    A B F

    0 0 1

    0 1 1

    1 0 1

    1 1 0

    A B F

    1 1 0

    1 0 0

    0 1 0

    0 0 1

    A B F

    low low high

    low high high

    high low high

    high high low

    Voltage Levels Negative Logic LevelsPositive Logic Levels

    Physical

    NAND gate

    A

    B

    FA

    BF = A B F = A + B

    A

    B

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    44/57

    Expressing duality with gates

    F = A + BA

    B

    A

    B

    A + B

    F = ABA

    B

    A

    B

    AB

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    45/57

    Properties of Boolean Algebra

    Relationship Dual Property

    A B = B

    A (B + C) = A B + A C

    1 A = A

    A A = 0

    postulates

    A + B = B + A

    A + B C = (A + B) (A + C)

    0 + A = A

    A + A = 1

    commutative

    Distributive

    Identity

    Complement

    0 A = 0

    A A = A

    A (B C) = (A B) C

    A = A

    A B = A + B

    AB + AC + BC = AB + AC

    A (A + B) = A

    Theorems

    1 + A = 1

    A + A = A

    A + (B + C) = (A + B) + C

    A + B = A B

    (A + B)(A + C)(B + C) = (A + B)(A + C)

    A + A B = A

    0 and 1 theorems

    Idempotence

    Associative

    Involution

    DeMorgans Theorem

    Consensus Theorem

    Absorption Theorem

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    46/57

    Sum of products form: majority function

    The sum of products form forthe 3-input majority functionis:

    M = ABC + ABC + ABC + ABC= m3 + m5 + m6 + m7 = (3, 5,

    6, 7) Each of the 2nterms are

    called minterms, ranging from0 2n1.

    Note relationship betweenminterm number and booleanvalue

    minterm

    indexA B C F

    0

    1

    23

    4

    5

    6

    7

    0

    0

    00

    1

    1

    1

    1

    0

    0

    11

    0

    0

    1

    1

    0

    1

    01

    0

    1

    0

    1

    0

    0

    01

    0

    1

    1

    1

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    47/57

    AND-OR implementation of majority

    A B C

    A B C

    A B C

    A B C

    F

    CBA

    Gate count is 8,gate input

    count is 19

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    48/57

    OR-ANDimplementation of majority

    A + B + C

    A + B + C

    A + B + C

    A + B + C

    F

    CBA

    Combinational Logic

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    49/57

    Combinational Logic Translates a set of inputs into a set of outputs according to

    one or more mapping functions.

    Inputs and outputs for a CLU normally have two distinct(binary) values: high and low, 1 and 0, 0 and 1, or 5 V and0 V for example.

    The outputs of a CLU are strictly functions of the inputs,

    and the outputs are updated immediately after the inputschange. A set of inputs i0in are presented to the CLU,which produces a set of outputs according to mappingfunctions f0fm.

    Combinational

    logic unit

    i0

    i1

    in

    f0(i0, i1)

    f1(i1, i3, i4)

    fm

    (i9, in)

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    50/57

    Some Definitions

    Combinational logic: a digital logic circuit in whichlogical decisions are made based only oncombinations of the inputs. e.g. an adder.

    Sequential logic: a circuit in which decisions aremade based on combinations of the current inputsas well as the past history of inputs. e.g. a memoryunit.

    Finite state machine: a circuit which has an internalstate, and whose outputs are functions of both

    current inputs and its internal state. e.g. a vendingmachine controllerexamplecoffee vendingmachinemust remember how many and what kindof coins have been inserted!

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    51/57

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    52/57

    Finite state machine

    An FSM iscomposed of acombinationallogic unit anddelay elements(called flip-flops) in afeedback path,whichmaintains stateinformation

    Combinational

    logic unit

    Q0 D0

    s0

    Qn Dn

    sn

    Delay elements(memory)

    Synchronization signal

    State bits

    OutputsInputs

    f0

    fm

    i0

    ik

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    53/57

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    54/57

    The mebi prefix

    The mebi-prefix was defined by the InternationalElectrotechnical Commission (IEC) in December 1998.Its use (and related units) is presently endorsed bythe Institute of Electrical and Electronics

    Engineers (IEEE) and the International Committee forWeights and Measures (CIPM) in contexts where use ofa binary prefix makes sense

    Binary prefixes are increasingly used in scientific

    literature and open source software. In productadvertising and other non-scientific publications, thekilobyte sometimes refers to a power of ten andsometimes a power of two

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    55/57

    Binary prefixes

    Value IEC

    1024 210 - Kilobyte KiB kibibyte

    1048576 220 - MB Megabyte MiB mebibyte

    1073741824 230 - GB Gigabyte GiB gibibyte

    1099511627776 240- TB Terabyte TiB tebibyte

    1125899906842624 250- PB Petabyte PiB pebibyte

    1152921504606846976 260- EB Exabyte EiB exbibyte

    1180591620717411303424 270- ZB Zettabyte ZiB zebibyte

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    56/57

    Some data

    It is estimated that the human brain's ability to store memories isequivalent to about 2.5 petabytes of binary data

    In January 2012, Cray began construction of the Blue WatersSupercomputer, which will have a capacity of 500 petabytes makingit the largest storage array ever if realized

    As of March 2010 the global Internet traffic is estimated at 21exabytes per month

    The 64-bit microprocessors found in many computerscan address 16 exabytes of memory

    The total amount of global data was expected to be 2.7 zettabytesduring 2012

    the new NSA Data Center south of Salt Lake City, UT, will be ableto contain up to 5 zettabytes of data, "according to some reports"

  • 8/9/2019 Lecture3 en Number Repr Boolean 2014(1)

    57/57

    Tasks Express the following numbers in sign-magnitude, 1`s complement, and

    2`s complement notations, assuming 8-bit representation: -119 - 55

    Show how the decimal integer -120 would be represented in 2`scomplement notation using:

    8 bits = ? 16 bits = ?

    The smallest (negative) number and the largest (positive) number thatcan be stored using the sign-magnitude notation.

    Smallest in Binary = Smallest in Decimal = Largest in Binary = Largest in Decimal =

    The smallest (negative) number and the largest (positive) number thatcan be stored using the 2`s complement notation. Smallest in Binary = Smallest in Decimal = Largest in Binary = Largest in Decimal =