SlideShare a Scribd company logo
1 of 13
Download to read offline
Computer Organization and Assembly
            Language

      Lecture 1 – Basic Concepts




         Virtual Machine

           High-level language     Level 5

           Assembly language       Level 4

            Operating System       Level 3

           Instruction Set Arch.   Level 2

            Microarchitecture      Level 1

              Digital Logic        Level 0
The Intel Microprocessor Family
• The Intel family owes its origins to the 8080, an 8-bit
  processor which could only access 64 kilobytes of
  memory.
• The 8086 (1978) had 16-bit registers, a 16-bit data bus, 20-
  bit memory using segmented memory. The IBM PC used
  the 8088, which was identical except it used an 8-bit data
  bus.
• 8087 - a math co-processor that worked together with the
  8086/8088. Without it, floating point arithmetic require
  complex software routines.
• 80286 - ran in real mode (like the 8086/8088) or in
  protected mode could access up tp 16MB using 24-bit
  addressing with a clock spped between 12 and 25 MHz. Its
  math co-processor was the 80287.




The Intel Microprocessor Family (continued)

• 80386 or i386 (1985) - used 32-bit registers and a 32-bit
  data bus. It could operate in real, protected or virtual
  mode. In virtual mode, multiple real-mode programs could
  be run.
• i486 - The instruction set was implemented with up to 5
  instructions fetched and decoded at once. SX version had
  its FPU disabled.
• The Pentium processor had an original clock speed of 90
  MHz and cold decode and executed two instructions at the
  same time, using dual pipelining.
Number Systems - Base 10
  The number system that we use is base 10:
  1734 = 1000 + 700 + 30 + 4
        = 1x1000 + 7x100 + 3x10 + 4x1
        = 1x103 + 7x102 + 3x101 + 4x100


  724.5 = 7x100 + 2x10 + 4x1 + 5x0.1
        = 7x102 + 2x101 + 4x100 + 5x10-1


  Why use base 10?




        Number Systems - Base 2
For computers, base 2 is more convenient (why?)
100112 = 1x16 + 0x8 + 0x4 + 1x2 + 1x1 = 1910
1000102 = 1x32 + 0x16 + 0x8 + 0x4 + 1x2 + 0x1 = 3410


101.0012 = 1x4 + 0x2 + 1x1 + 0x0.5 + 0x0.25 + 1x0.125
        = 5.12510
Example -     11010112 = ?
              101101112 = ?
              10100.11012 = ?
Number Systems - Base 16
 Hexadecimal (base 16) numbers are commonly used
 because it is convert them into binary (base 2) and vice
 versa.
 8CE16 = 8x256 + 12x16 + 14x1
         = 2048 + 192 + 14
         = 2254


 3F9     = 3x256 + 15x16 + 9x1
         = 768 + 240 + 9 = 1017




  Number Systems - Base 16 (continued)

Base 2 is easily converted into base 16:
1000110011102 = 1000 1100 1110 = 8 C E 16
111011011101010012 = 1 1101 1011 1010 1001 = 1 D B A 916
101100010100000101112 = ?16
1011010100101110112 = ?16
Number Systems - Base 16 (continued)
Converting base 16 into base 2 works the same way:
F3A516 = 1111 0011 1010 01012
76EF16 = 0111 0110 1110 11112


AB3D16 = ?2
15C.3816 = ?2




 Converting From Decimal to Binary
   19             100112
    9R1
    4R1

    2R0
    1R0

    0R1
Converting From Decimal to Binary

  34                 1000102
  17 R 0

   8R1

   4R0
   2R0

   1R0

   0R1




Converting From Binary to Decimal

10010102 = 1x64 + 0x32 + 0x16 + 1x8 + 0x4 + 1x2 + 0x1
           = 64 + 8 + 2 = 7410


11011010112 = 1x512 + 1x256 + 0x128 + 1x64 + 1x32
                       + 0x16 + 8x1 + 0x4 + 1x2 + 1x1
               = 512 + 256 + 64 + 32 + 8 + 2 + 1 = 87510
Signed numbers

      0         1   0        0   1    0     1         1   = 7510

     sign bit


      1         0   1        1   0    1     0         1   = -7510

     sign bit                  01001011
                               10110101
                             1 00000000


                             overflow bit




                Binary Bit Position Values
20                       1                      28                    256
21                       2                      29                    512

22                       4                      210                  1024

23                       8                      211                  2048

24                      16                      212                  4096

25                      32                      213                  8192
26                      64                      214                 16384

27                  128                         215                 32768
Binary, Decimal and Hexadecimal Equivalents
Binary    Decimal      Hex.          Binary        Decimal   Hex.
0000             0       0             1000           8      8

0001             1       1            1001            9      9

0010             2       2            1010           10      A

0011             3       3            10111          11      B

0100             4       4            1100           12      C
0101             5       5            1101           13      D

0110             6       6            1110           14      E

0111             7       7            1111           15      F




                     Types of Numbers

   Storage Type               Bits   Range (low-high)
   Signed byte                 7      -128 to +127
   Unsigned byte               8      0 to 255
   Signed word                15     -32,768 to +32,767
   Unsigned word              16     0 to 65,535
   Signed doubleword          31     -2,147,483,648 to +2,147,483,648
   Unsigned doubleword        32     0 to 4,294, 967,295
   Signed quadword            63     -9,223,372,036,854,775,808 to
                                     +9,223,372,036,854,775,807
   Unsigned quadword          64     0 to 8,446,744,073,709,551,615
ASCII representation of characters
•   ASCII (American Standard Code for Information Interchange) is a
    numeric code used to represent characters.
•   All characters are represented this way including:
     – words (character strings)
     – numbers
     – punctuation
     – control characters
•   There are separate values for upper case and lower case characters:
                   A        65        z       122
                   B        66        blank    32
                   Z        90        $        52
                   a        97        0        48
                   b        98        9        57x




     Boolean Values and Expressions

• A boolean value is either true or false
• Boolean expressions involve boolean values and
  boolean operators.
• There are three primary boolean operators about
  which we are interested:
   – NOT
   – AND
   – OR
The NOT Operator

    x       ~x

    F       T

    T       F




The AND Operator

X       Y   X ∧Y
F       F        F
F       T        F
T       F        F
T       T        T
The OR Operator

          X     Y      X∨Y
          F     F       F
          F     T       T
          T     F       T
          T     T       T




      Operator Precedence
                NOT
                AND         Higher
                 OR         precedence
Examples:
  ~x ∨ y            NOT, then OR
  ~(x ∨ y)          OR, then NOT
  x ∨ (y ∧ z)       AND, then OR
Boolean Functions – An Example
Boolean functions take boolean inputs and produce boolean
outputs, e.g., ~x ∨ y

           x         ~x           y        ~x ∨ y
           F          T           F          T
           F          T           T          T
          T           F           F          F
          T           F           T          T




 Boolean Functions – Another Example

E. g., x ∧ ~y


           x          y          ~Y       ~x ∧ y
           F          F           T          F
           F          T           F          F
          T           F           T          T
          T           T           F          F
One Last Example - (y ∧ s) ∨ (x ∧ ~s)
x   y   s y ∧ s ~s   x ∧ ~s (y ∧ s) ∨ (x ∧ ~s)
F   F   F   F   T      F             F
F   F   T   F   F      F             F
F   T   F   F   T      F             F
F   T   T   T   F      F             T
T   F   F   F   T      T             T
T   F   T   F   F      T             T
T   T   F   F   T      F             F
T   T   T   T   F      F             T

More Related Content

What's hot

Number system logic gates
Number system logic gatesNumber system logic gates
Number system logic gatesJaipal Dhobale
 
Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...
Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...
Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...Hsien-Hsin Sean Lee, Ph.D.
 
boolean algebra and logic simplification
boolean algebra and logic simplificationboolean algebra and logic simplification
boolean algebra and logic simplificationUnsa Shakir
 
Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)Frankie Jones
 
Combinational logic 2
Combinational logic 2Combinational logic 2
Combinational logic 2Heman Pathak
 
Combinational logic 1
Combinational logic 1Combinational logic 1
Combinational logic 1Heman Pathak
 
Numbersystemcont
NumbersystemcontNumbersystemcont
NumbersystemcontSajib
 
B sc cs i bo-de u-ii logic gates
B sc cs i bo-de u-ii logic gatesB sc cs i bo-de u-ii logic gates
B sc cs i bo-de u-ii logic gatesRai University
 
Sequential Circuit
Sequential CircuitSequential Circuit
Sequential CircuitHeman Pathak
 
Encoder for (7,3) cyclic code using matlab
Encoder for (7,3) cyclic code using matlabEncoder for (7,3) cyclic code using matlab
Encoder for (7,3) cyclic code using matlabSneheshDutta
 
Advanced encryption standard ug reseacrh
Advanced encryption standard ug reseacrhAdvanced encryption standard ug reseacrh
Advanced encryption standard ug reseacrhAkashRanjandas1
 
02 combinational logic
02 combinational logic02 combinational logic
02 combinational logicZainab Noor
 

What's hot (20)

Number system logic gates
Number system logic gatesNumber system logic gates
Number system logic gates
 
EE8351 DLC
EE8351 DLCEE8351 DLC
EE8351 DLC
 
Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...
Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...
Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...
 
Boolean Logic
Boolean LogicBoolean Logic
Boolean Logic
 
boolean algebra and logic simplification
boolean algebra and logic simplificationboolean algebra and logic simplification
boolean algebra and logic simplification
 
Ch1 2
Ch1 2Ch1 2
Ch1 2
 
Parallel adders
Parallel addersParallel adders
Parallel adders
 
Datapath subsystem multiplication
Datapath subsystem multiplicationDatapath subsystem multiplication
Datapath subsystem multiplication
 
Lec5 encoder
Lec5 encoderLec5 encoder
Lec5 encoder
 
Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)
 
Combinational logic 2
Combinational logic 2Combinational logic 2
Combinational logic 2
 
Combinational logic 1
Combinational logic 1Combinational logic 1
Combinational logic 1
 
Numbersystemcont
NumbersystemcontNumbersystemcont
Numbersystemcont
 
B sc cs i bo-de u-ii logic gates
B sc cs i bo-de u-ii logic gatesB sc cs i bo-de u-ii logic gates
B sc cs i bo-de u-ii logic gates
 
Sequential Circuit
Sequential CircuitSequential Circuit
Sequential Circuit
 
Encoder for (7,3) cyclic code using matlab
Encoder for (7,3) cyclic code using matlabEncoder for (7,3) cyclic code using matlab
Encoder for (7,3) cyclic code using matlab
 
Advanced encryption standard ug reseacrh
Advanced encryption standard ug reseacrhAdvanced encryption standard ug reseacrh
Advanced encryption standard ug reseacrh
 
Ch3
Ch3Ch3
Ch3
 
02 combinational logic
02 combinational logic02 combinational logic
02 combinational logic
 
Digital Search Tree
Digital Search TreeDigital Search Tree
Digital Search Tree
 

Viewers also liked

4 inclusao relacoes
4 inclusao relacoes4 inclusao relacoes
4 inclusao relacoestatyathaydes
 
Hr经典面试25问及回答策略
Hr经典面试25问及回答策略Hr经典面试25问及回答策略
Hr经典面试25问及回答策略Eding bao
 
Conteudo programatico enem 2011
Conteudo programatico enem 2011Conteudo programatico enem 2011
Conteudo programatico enem 2011luizrosedanibruno
 
Herramientas informáticas 1 DIANA ITZEL MUÑOZ ARROYO 3.3
Herramientas informáticas 1 DIANA ITZEL MUÑOZ ARROYO 3.3Herramientas informáticas 1 DIANA ITZEL MUÑOZ ARROYO 3.3
Herramientas informáticas 1 DIANA ITZEL MUÑOZ ARROYO 3.3Diayara
 
What your Ring Reveals about you? “Infographic”
What your Ring Reveals about you? “Infographic”What your Ring Reveals about you? “Infographic”
What your Ring Reveals about you? “Infographic”classiccreations
 
I love New York 2
I love New York 2I love New York 2
I love New York 2Jeshua _192
 
Ute eprendimiento social como marco de análisis; el liderazgo de los emprend...
Ute eprendimiento social como marco de análisis;  el liderazgo de los emprend...Ute eprendimiento social como marco de análisis;  el liderazgo de los emprend...
Ute eprendimiento social como marco de análisis; el liderazgo de los emprend...Leo Rivera
 
Trabajo a distancia de computacion basic1
Trabajo a distancia de computacion basic1Trabajo a distancia de computacion basic1
Trabajo a distancia de computacion basic1blanca
 
Resolutivo ranch san lucas
Resolutivo ranch san lucasResolutivo ranch san lucas
Resolutivo ranch san lucasACATL_ARCE
 
Interoperabilidad - Modelo de Gestion Documental de la RTA
Interoperabilidad - Modelo de Gestion Documental de la RTAInteroperabilidad - Modelo de Gestion Documental de la RTA
Interoperabilidad - Modelo de Gestion Documental de la RTAHiriam Eduardo Perez Vidal
 

Viewers also liked (20)

4 inclusao relacoes
4 inclusao relacoes4 inclusao relacoes
4 inclusao relacoes
 
40
4040
40
 
Comenius Flash Meeting
Comenius Flash MeetingComenius Flash Meeting
Comenius Flash Meeting
 
Hr经典面试25问及回答策略
Hr经典面试25问及回答策略Hr经典面试25问及回答策略
Hr经典面试25问及回答策略
 
Textos a pares
Textos a paresTextos a pares
Textos a pares
 
Conteudo programatico enem 2011
Conteudo programatico enem 2011Conteudo programatico enem 2011
Conteudo programatico enem 2011
 
Te Deseo :Victor Hugo
Te Deseo :Victor HugoTe Deseo :Victor Hugo
Te Deseo :Victor Hugo
 
Herramientas informáticas 1 DIANA ITZEL MUÑOZ ARROYO 3.3
Herramientas informáticas 1 DIANA ITZEL MUÑOZ ARROYO 3.3Herramientas informáticas 1 DIANA ITZEL MUÑOZ ARROYO 3.3
Herramientas informáticas 1 DIANA ITZEL MUÑOZ ARROYO 3.3
 
What your Ring Reveals about you? “Infographic”
What your Ring Reveals about you? “Infographic”What your Ring Reveals about you? “Infographic”
What your Ring Reveals about you? “Infographic”
 
tipos de crisis
tipos de crisistipos de crisis
tipos de crisis
 
Nada
NadaNada
Nada
 
I love New York 2
I love New York 2I love New York 2
I love New York 2
 
Ute eprendimiento social como marco de análisis; el liderazgo de los emprend...
Ute eprendimiento social como marco de análisis;  el liderazgo de los emprend...Ute eprendimiento social como marco de análisis;  el liderazgo de los emprend...
Ute eprendimiento social como marco de análisis; el liderazgo de los emprend...
 
óCio, LaZer e TIC
óCio, LaZer e TICóCio, LaZer e TIC
óCio, LaZer e TIC
 
Trabajo a distancia de computacion basic1
Trabajo a distancia de computacion basic1Trabajo a distancia de computacion basic1
Trabajo a distancia de computacion basic1
 
Resolutivo ranch san lucas
Resolutivo ranch san lucasResolutivo ranch san lucas
Resolutivo ranch san lucas
 
Costos de producción
Costos de producciónCostos de producción
Costos de producción
 
Silabo
SilaboSilabo
Silabo
 
La guía de anuncios de twitter
La guía de anuncios de twitterLa guía de anuncios de twitter
La guía de anuncios de twitter
 
Interoperabilidad - Modelo de Gestion Documental de la RTA
Interoperabilidad - Modelo de Gestion Documental de la RTAInteroperabilidad - Modelo de Gestion Documental de la RTA
Interoperabilidad - Modelo de Gestion Documental de la RTA
 

Similar to Lecture.1

LOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAVLOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAVDeepak Yadav
 
Lecture4 binary-numbers-logic-operations
Lecture4  binary-numbers-logic-operationsLecture4  binary-numbers-logic-operations
Lecture4 binary-numbers-logic-operationsmarkme18
 
Computer archi&mp
Computer archi&mpComputer archi&mp
Computer archi&mpMSc CST
 
Javascript engine performance
Javascript engine performanceJavascript engine performance
Javascript engine performanceDuoyi Wu
 
Number systems presentation
Number systems presentationNumber systems presentation
Number systems presentationJiian Francisco
 
javaPrimitiveTypes.pptx
javaPrimitiveTypes.pptxjavaPrimitiveTypes.pptx
javaPrimitiveTypes.pptxMattMarino13
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptxGobinathAECEJRF1101
 
01.number systems
01.number systems01.number systems
01.number systemsrasha3
 
Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)SoumyaBhattacharyya14
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptxAminaZahid16
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in indiaEdhole.com
 

Similar to Lecture.1 (20)

LOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAVLOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAV
 
Lecture4 binary-numbers-logic-operations
Lecture4  binary-numbers-logic-operationsLecture4  binary-numbers-logic-operations
Lecture4 binary-numbers-logic-operations
 
Chapter-04.pdf
Chapter-04.pdfChapter-04.pdf
Chapter-04.pdf
 
Bitwise
BitwiseBitwise
Bitwise
 
UNIT-1_CSA.pdf
UNIT-1_CSA.pdfUNIT-1_CSA.pdf
UNIT-1_CSA.pdf
 
Computer archi&mp
Computer archi&mpComputer archi&mp
Computer archi&mp
 
Ccent notes part 3
Ccent notes part 3Ccent notes part 3
Ccent notes part 3
 
Booth Multiplier
Booth MultiplierBooth Multiplier
Booth Multiplier
 
Javascript engine performance
Javascript engine performanceJavascript engine performance
Javascript engine performance
 
Number systems presentation
Number systems presentationNumber systems presentation
Number systems presentation
 
Sistem bilangan
Sistem bilanganSistem bilangan
Sistem bilangan
 
javaPrimitiveTypes.pptx
javaPrimitiveTypes.pptxjavaPrimitiveTypes.pptx
javaPrimitiveTypes.pptx
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Number system
Number systemNumber system
Number system
 
01.number systems
01.number systems01.number systems
01.number systems
 
Chapter 03 cyclic codes
Chapter 03   cyclic codesChapter 03   cyclic codes
Chapter 03 cyclic codes
 
microprocessors
microprocessorsmicroprocessors
microprocessors
 
Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptx
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 

Lecture.1

  • 1. Computer Organization and Assembly Language Lecture 1 – Basic Concepts Virtual Machine High-level language Level 5 Assembly language Level 4 Operating System Level 3 Instruction Set Arch. Level 2 Microarchitecture Level 1 Digital Logic Level 0
  • 2. The Intel Microprocessor Family • The Intel family owes its origins to the 8080, an 8-bit processor which could only access 64 kilobytes of memory. • The 8086 (1978) had 16-bit registers, a 16-bit data bus, 20- bit memory using segmented memory. The IBM PC used the 8088, which was identical except it used an 8-bit data bus. • 8087 - a math co-processor that worked together with the 8086/8088. Without it, floating point arithmetic require complex software routines. • 80286 - ran in real mode (like the 8086/8088) or in protected mode could access up tp 16MB using 24-bit addressing with a clock spped between 12 and 25 MHz. Its math co-processor was the 80287. The Intel Microprocessor Family (continued) • 80386 or i386 (1985) - used 32-bit registers and a 32-bit data bus. It could operate in real, protected or virtual mode. In virtual mode, multiple real-mode programs could be run. • i486 - The instruction set was implemented with up to 5 instructions fetched and decoded at once. SX version had its FPU disabled. • The Pentium processor had an original clock speed of 90 MHz and cold decode and executed two instructions at the same time, using dual pipelining.
  • 3. Number Systems - Base 10 The number system that we use is base 10: 1734 = 1000 + 700 + 30 + 4 = 1x1000 + 7x100 + 3x10 + 4x1 = 1x103 + 7x102 + 3x101 + 4x100 724.5 = 7x100 + 2x10 + 4x1 + 5x0.1 = 7x102 + 2x101 + 4x100 + 5x10-1 Why use base 10? Number Systems - Base 2 For computers, base 2 is more convenient (why?) 100112 = 1x16 + 0x8 + 0x4 + 1x2 + 1x1 = 1910 1000102 = 1x32 + 0x16 + 0x8 + 0x4 + 1x2 + 0x1 = 3410 101.0012 = 1x4 + 0x2 + 1x1 + 0x0.5 + 0x0.25 + 1x0.125 = 5.12510 Example - 11010112 = ? 101101112 = ? 10100.11012 = ?
  • 4. Number Systems - Base 16 Hexadecimal (base 16) numbers are commonly used because it is convert them into binary (base 2) and vice versa. 8CE16 = 8x256 + 12x16 + 14x1 = 2048 + 192 + 14 = 2254 3F9 = 3x256 + 15x16 + 9x1 = 768 + 240 + 9 = 1017 Number Systems - Base 16 (continued) Base 2 is easily converted into base 16: 1000110011102 = 1000 1100 1110 = 8 C E 16 111011011101010012 = 1 1101 1011 1010 1001 = 1 D B A 916 101100010100000101112 = ?16 1011010100101110112 = ?16
  • 5. Number Systems - Base 16 (continued) Converting base 16 into base 2 works the same way: F3A516 = 1111 0011 1010 01012 76EF16 = 0111 0110 1110 11112 AB3D16 = ?2 15C.3816 = ?2 Converting From Decimal to Binary 19 100112 9R1 4R1 2R0 1R0 0R1
  • 6. Converting From Decimal to Binary 34 1000102 17 R 0 8R1 4R0 2R0 1R0 0R1 Converting From Binary to Decimal 10010102 = 1x64 + 0x32 + 0x16 + 1x8 + 0x4 + 1x2 + 0x1 = 64 + 8 + 2 = 7410 11011010112 = 1x512 + 1x256 + 0x128 + 1x64 + 1x32 + 0x16 + 8x1 + 0x4 + 1x2 + 1x1 = 512 + 256 + 64 + 32 + 8 + 2 + 1 = 87510
  • 7. Signed numbers 0 1 0 0 1 0 1 1 = 7510 sign bit 1 0 1 1 0 1 0 1 = -7510 sign bit 01001011 10110101 1 00000000 overflow bit Binary Bit Position Values 20 1 28 256 21 2 29 512 22 4 210 1024 23 8 211 2048 24 16 212 4096 25 32 213 8192 26 64 214 16384 27 128 215 32768
  • 8. Binary, Decimal and Hexadecimal Equivalents Binary Decimal Hex. Binary Decimal Hex. 0000 0 0 1000 8 8 0001 1 1 1001 9 9 0010 2 2 1010 10 A 0011 3 3 10111 11 B 0100 4 4 1100 12 C 0101 5 5 1101 13 D 0110 6 6 1110 14 E 0111 7 7 1111 15 F Types of Numbers Storage Type Bits Range (low-high) Signed byte 7 -128 to +127 Unsigned byte 8 0 to 255 Signed word 15 -32,768 to +32,767 Unsigned word 16 0 to 65,535 Signed doubleword 31 -2,147,483,648 to +2,147,483,648 Unsigned doubleword 32 0 to 4,294, 967,295 Signed quadword 63 -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 Unsigned quadword 64 0 to 8,446,744,073,709,551,615
  • 9. ASCII representation of characters • ASCII (American Standard Code for Information Interchange) is a numeric code used to represent characters. • All characters are represented this way including: – words (character strings) – numbers – punctuation – control characters • There are separate values for upper case and lower case characters: A 65 z 122 B 66 blank 32 Z 90 $ 52 a 97 0 48 b 98 9 57x Boolean Values and Expressions • A boolean value is either true or false • Boolean expressions involve boolean values and boolean operators. • There are three primary boolean operators about which we are interested: – NOT – AND – OR
  • 10. The NOT Operator x ~x F T T F The AND Operator X Y X ∧Y F F F F T F T F F T T T
  • 11. The OR Operator X Y X∨Y F F F F T T T F T T T T Operator Precedence NOT AND Higher OR precedence Examples: ~x ∨ y NOT, then OR ~(x ∨ y) OR, then NOT x ∨ (y ∧ z) AND, then OR
  • 12. Boolean Functions – An Example Boolean functions take boolean inputs and produce boolean outputs, e.g., ~x ∨ y x ~x y ~x ∨ y F T F T F T T T T F F F T F T T Boolean Functions – Another Example E. g., x ∧ ~y x y ~Y ~x ∧ y F F T F F T F F T F T T T T F F
  • 13. One Last Example - (y ∧ s) ∨ (x ∧ ~s) x y s y ∧ s ~s x ∧ ~s (y ∧ s) ∨ (x ∧ ~s) F F F F T F F F F T F F F F F T F F T F F F T T T F F T T F F F T T T T F T F F T T T T F F T F F T T T T F F T