SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
NUMBER SYSTEM
Positional Number Systems

- Each digit position has an associated
  weight

- The value of the number i a weighted
   h    l    f h      b is      i h d
  sum of the digits

- Th di it i position I h weight ri ,
  The digit in    iti    has i ht
  Where r is the radix (base)
                       (    )
O
Octal and Hexadecimal Numbers
- Radix 8 and 16
- Useful for representing multi-bit numbers
               p        g
-Conversion from binary is done
by separating the bits into groups of
three or four (R-L) and replace each group
with the corresponding octal or hexadecimal
number
- If the number contains digits to the right of the
 binary point, we group the part after the binary
 point(L-R)
- To convert from Octal and Hexadecimal, we
 replace each digit with the corresponding 3 or
 4 bits string
        string.
- Conversion from Decimal to Binary,Octal &
                                  y,
 Hexadecimal is achieved by dividing by the
 radix.
Fractions

Binary to decimal
10.1011 >
10 1011 =>
              1   x   2-4    =   0.0625
              1   x   2-3    =   0.125
              0   x   2-22   =   0.0
                                 0 0
              1   x   2-1    =   0.5
              0   x   20     =   0.0
              1   x   21     =   2.0
                                 2 0
                                 2.6875
Fractions
Fractions
(0.375)10
0.375 X 2 = 0.750 0
0.750 X 2 = 1.500 1
1.500
1 500 X 2 = 1 000 1
            1.000
000 X 0 = 0          0
      (0.375)10= (0.011)2
• Octal Addition (&
  Subtraction)
• 11
  456
  123
  601
Hexadecimal Addition (&
            Subtraction)
A   C   5   A   9
E   D   6   9   4
                D
Representation of negative numbers
 ep ese tat o o egat ve u be s

- Singed-magnitude system: the number consists
  Singed magnitude
  of magnitude and symbol. The MSB is for the sign
  0 means positive &1 means negative

- There are two representation for 0 1000 ( 0) &
                                   0,     (-0)
  0000 (+0).

- For n-bit integer the range is –(2n-1 – 1) to +(2n-1-1)

  +18 = 00010010
  -18 = 10010010
   18
- One complement : The MSB is for the sign.

- Boolean complement all bits to negate
   +18 = 00010010
   -18 = 11101101

- Two representations of zero: 0000 (+0)
                               1111 (-0)

- The range is –(2n-1 – 1) to +(2n-1-1).
                (2n            (2n 1).
- Two’s complement: MSB is for the sign
                                   sign.


- The range is –(2n-1) to (2n-1-1)
                (2             -1).

-                          3 = 00000011
    Boolean complement gives 11111100
    B l         l        i
               Add 1 to LSB          +1
                              11111101
- Only one representation for 0
                              0.

              0 = 00000000
     Bitwise not     11111111
  Add 1 t LSB
         to                +1
      Result       1 00000000
Overflow is ignored, so:
-0=0
-T ’
 Two’s   C
         Complement Additi
             l    t Addition

Overflow: An addition overflows if the
signs of the addends are the same and the
sign of the sum i diff
 i    f h       is different f
                             from
the addends’ sign
    addends sign.
1001              1100
 + 0101            + 0100
    1110 = -2        10000 = 0
(a) ( 7) + (+5)
    (-7)          (b) ( 4) + (+4)
                      (-4)

     0011              1100
 + 0100             + 1111
    0111 = 7           11011 = -5
(c) (+3) + (+4)   (d) (-4) + (-1)
0101                1001
+ 0100              + 1010
  1001 = Overflow     0011 = Overflow
(e) (+5) + (+4)      (f) (-7) + (-6)
Subtraction l
S bt ti rules:

Perform a bit-by-bit complement of the
subtrahend and add the complemented
subtrahend to the minuend with an initial
carry in of 1 instead of 0.
0010                  0101
 + 1001                  + 1110
      1011 = -5            10011 = 3
(a) M = 2 = 0010    (b) M = 5 = 0101
     S = 7 = 0111       S = 2 = 0010
    -S = 1001
     S                  -S = 1110
                         S
1011              0101
  + 1110            + 0010
   11001 = -7         0111 = 7

(c)
( ) M = -5 = 1011
         5          (d) M = 5 = 0101
     S = 2 = 0010       S = -2 = 1110
    -S = 1110          -S = 0010
0111                1010
 + 0111              + 1100
   1110 = Overflow    10110 = Overflow

(e) M = 7 = 0111     (f) M = -6 = 1010
     S = -7 = 1001
          7               S = 4 = 0100
    -S = 0111                -S = 1100
The Byte Nibble, and Word
    Byte, Nibble

• 1 byte = 8 bits
• 1 nibble = 4 bits
• 1 word = size depends on d t pathway
        d i d        d     data th
  size.
  – Word size in a simple system may be one
    byte (8 bits)
  – Word size in a PC is eight bytes (64 bits)
-Codes are group of special symbols used t
 C d               f      i l    b l   d to
represent numbers, letters or words.

1- Binary codes for decimal numbers (BCD)
        y                           (   )

- Binary Coded Decimal (BCD) is another way
  to present decimal numbers in binary form.

- BCD is widely used and combines features of
  both decimal and binary systems.
- Each digit of a decimal is represented by its
  four bit
  four-bit binary equivalent (1 to 9)

- To represent the decimal number 10 we need
                           n mber     e
  eight bits (0001 0000)
• To convert the number 87410 to BCD

     8           7          4      (decimal)

    1000       0111       0100       (BCD)

• Each digit always uses four bits.
   ac d g t a ways        ou b ts.
• The BCD value can never be greater than 9
• Reverse the process to convert BCD to decimal.
• BCD i not a number system.
      is t       b      t

• BCD is a decimal number with each digit
  encoded to its binary equivalent.
                        equivalent

• A BCD number is not the same as a straight
  binary number.
         number

• The primary advantage of BCD is the relative
  ease of converting to and from decimal.
Decimal Binary Octal Hexadecimal   BCD
   0      0     0         0          0
   1      1     1         1        0001
   2      10    2         2        0010
   3      11    3         3        0011
   4     100    4         4        0100
   5     101    5         5        0101
   6     110    6         6        0110
   7     111    7         7        0111
   8     1000   10        8        1000
   9     1001   11        9        1001
  10     1010   12       A       0001 0000
  11     1011   13       B       0001 0001
  12     1100   14       C       0001 0010
  13     1101   15       D       0001 0011
  14     1110   16       E       0001 0100
  15     1111   17        F      0001 0101
2
2- American Standard Code for Information
   Interchange (ASCII)

- It is a seven bit code. It has 27 possible code
groups.

- Represents characters and functions found on
a computer keyboard.

- Examples of use are: to transfer information
between computers, between computers and
printers, and f i
  i         d for internal storage.
                         l
3-
3 Gray code
Two successive values differ in only one bit
Number system
Number system
• 4- Codes for detecting and correcting
  errors

•   Error means corruption of data
                              data.
•       - Parity Bit
•       - Hamming C d
                  i  Code
Parity bit:
 It is an extra bit that is attached to
 a code group that is being transferred from one
location to another. It is made either 0
or 1 Depending on the number of 1 that
    1.      di        h       b    f 1s h
are contained in the code group.

Even parity:
The value of the parity bit is chosen so that
the total number of 1s including the parity
                    1s,
bit, is an even number;
             1 1000011
Odd parity:
The value of the parity bit is chosen
so th t th t t l number of 1 i l di th
   that the total      b   f 1s, including the
parity bit, is an odd number;
              1 1000001
Assignment (1)

1- Indicate whether or not overflow occurs
when adding the following 8-bits
                            8 bits
two’s complement numbers 00100110
                             + 01011010
(2.12 d textbok2)

2- 2-1.c (textbook1)
3- 2-11.c
4 2 19.c
4- 2-19.c
5- 2-24

Contenu connexe

Tendances

Tendances (20)

Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number system
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
Bolum1cozumler
Bolum1cozumlerBolum1cozumler
Bolum1cozumler
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
06 floating point
06 floating point06 floating point
06 floating point
 
Number System
Number SystemNumber System
Number System
 
Pp02
Pp02Pp02
Pp02
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbers
 
08. Numeral Systems
08. Numeral Systems08. Numeral Systems
08. Numeral Systems
 
B sc ii sem unit 2(a) ns
B sc ii sem  unit 2(a) nsB sc ii sem  unit 2(a) ns
B sc ii sem unit 2(a) ns
 
Logic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and CodesLogic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and Codes
 
PPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEMPPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEM
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
 
Floating Point Numbers
Floating Point NumbersFloating Point Numbers
Floating Point Numbers
 
Basic of number system
Basic of number systemBasic of number system
Basic of number system
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
 
Numbersystemcont
NumbersystemcontNumbersystemcont
Numbersystemcont
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbers
 
B sc3 unit 2 number system
B sc3  unit 2 number systemB sc3  unit 2 number system
B sc3 unit 2 number system
 

En vedette

De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910lvquy
 
Better Brainsrorming
Better BrainsrormingBetter Brainsrorming
Better BrainsrormingBrian Matt
 
De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910lvquy
 
Green Portfolio
Green PortfolioGreen Portfolio
Green PortfolioBrian Matt
 
De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910lvquy
 
The Real World: D E S I G N
The Real World:  D E S I G NThe Real World:  D E S I G N
The Real World: D E S I G NBrian Matt
 

En vedette (9)

De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910
 
Niyc pp
Niyc ppNiyc pp
Niyc pp
 
Better Brainsrorming
Better BrainsrormingBetter Brainsrorming
Better Brainsrorming
 
De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910
 
Meet Altitude
Meet AltitudeMeet Altitude
Meet Altitude
 
Green Portfolio
Green PortfolioGreen Portfolio
Green Portfolio
 
De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910De thi hoc ki 2 k12 nam 0910
De thi hoc ki 2 k12 nam 0910
 
Id Portfolio
Id PortfolioId Portfolio
Id Portfolio
 
The Real World: D E S I G N
The Real World:  D E S I G NThe Real World:  D E S I G N
The Real World: D E S I G N
 

Similaire à Number system

Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009lionking
 
Chapter 02 Data Types
Chapter 02   Data TypesChapter 02   Data Types
Chapter 02 Data TypesNathan Yeung
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptssuser52a19e
 
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalUtkirjonUbaydullaev1
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptRAJKUMARP63
 
Data representation
Data representationData representation
Data representationChew Hoong
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptRabiaAsif31
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in indiaEdhole.com
 
NumberSystemsAnnotated.pdf
NumberSystemsAnnotated.pdfNumberSystemsAnnotated.pdf
NumberSystemsAnnotated.pdfMarzCasipong1
 
08 Numeral systems
08 Numeral systems08 Numeral systems
08 Numeral systemsmaznabili
 
Binary octal
Binary octalBinary octal
Binary octaldrdipo4
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in indiaEdhole.com
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptxAminaZahid16
 

Similaire à Number system (20)

Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
Chapter 02 Data Types
Chapter 02   Data TypesChapter 02   Data Types
Chapter 02 Data Types
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and Hexadecimal
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
binary-numbers.ppt
binary-numbers.pptbinary-numbers.ppt
binary-numbers.ppt
 
Data representation
Data representationData representation
Data representation
 
number system
number systemnumber system
number system
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
Alu1
Alu1Alu1
Alu1
 
NumberSystemsAnnotated.pdf
NumberSystemsAnnotated.pdfNumberSystemsAnnotated.pdf
NumberSystemsAnnotated.pdf
 
08 Numeral systems
08 Numeral systems08 Numeral systems
08 Numeral systems
 
number system.ppt
number system.pptnumber system.ppt
number system.ppt
 
Binary octal
Binary octalBinary octal
Binary octal
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptx
 

Dernier

How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17Celine George
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptxSandy Millin
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxKatherine Villaluna
 
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxPISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxEduSkills OECD
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRATanmoy Mishra
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxheathfieldcps1
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and stepobaje godwin sunday
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.raviapr7
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17Celine George
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational PhilosophyShuvankar Madhu
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphNetziValdelomar1
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesMohammad Hassany
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxraviapr7
 

Dernier (20)

How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
Prelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quizPrelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quiz
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
 
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxPISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptx
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and step
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational Philosophy
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a Paragraph
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming Classes
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptx
 

Number system

  • 2. Positional Number Systems - Each digit position has an associated weight - The value of the number i a weighted h l f h b is i h d sum of the digits - Th di it i position I h weight ri , The digit in iti has i ht Where r is the radix (base) ( )
  • 3. O Octal and Hexadecimal Numbers - Radix 8 and 16 - Useful for representing multi-bit numbers p g -Conversion from binary is done by separating the bits into groups of three or four (R-L) and replace each group with the corresponding octal or hexadecimal number
  • 4. - If the number contains digits to the right of the binary point, we group the part after the binary point(L-R) - To convert from Octal and Hexadecimal, we replace each digit with the corresponding 3 or 4 bits string string. - Conversion from Decimal to Binary,Octal & y, Hexadecimal is achieved by dividing by the radix.
  • 5. Fractions Binary to decimal 10.1011 > 10 1011 => 1 x 2-4 = 0.0625 1 x 2-3 = 0.125 0 x 2-22 = 0.0 0 0 1 x 2-1 = 0.5 0 x 20 = 0.0 1 x 21 = 2.0 2 0 2.6875
  • 7. Fractions (0.375)10 0.375 X 2 = 0.750 0 0.750 X 2 = 1.500 1 1.500 1 500 X 2 = 1 000 1 1.000 000 X 0 = 0 0 (0.375)10= (0.011)2
  • 8. • Octal Addition (& Subtraction) • 11 456 123 601
  • 9. Hexadecimal Addition (& Subtraction) A C 5 A 9 E D 6 9 4 D
  • 10. Representation of negative numbers ep ese tat o o egat ve u be s - Singed-magnitude system: the number consists Singed magnitude of magnitude and symbol. The MSB is for the sign 0 means positive &1 means negative - There are two representation for 0 1000 ( 0) & 0, (-0) 0000 (+0). - For n-bit integer the range is –(2n-1 – 1) to +(2n-1-1) +18 = 00010010 -18 = 10010010 18
  • 11. - One complement : The MSB is for the sign. - Boolean complement all bits to negate +18 = 00010010 -18 = 11101101 - Two representations of zero: 0000 (+0) 1111 (-0) - The range is –(2n-1 – 1) to +(2n-1-1). (2n (2n 1).
  • 12. - Two’s complement: MSB is for the sign sign. - The range is –(2n-1) to (2n-1-1) (2 -1). - 3 = 00000011 Boolean complement gives 11111100 B l l i Add 1 to LSB +1 11111101
  • 13. - Only one representation for 0 0. 0 = 00000000 Bitwise not 11111111 Add 1 t LSB to +1 Result 1 00000000 Overflow is ignored, so: -0=0
  • 14. -T ’ Two’s C Complement Additi l t Addition Overflow: An addition overflows if the signs of the addends are the same and the sign of the sum i diff i f h is different f from the addends’ sign addends sign.
  • 15. 1001 1100 + 0101 + 0100 1110 = -2 10000 = 0 (a) ( 7) + (+5) (-7) (b) ( 4) + (+4) (-4) 0011 1100 + 0100 + 1111 0111 = 7 11011 = -5 (c) (+3) + (+4) (d) (-4) + (-1)
  • 16. 0101 1001 + 0100 + 1010 1001 = Overflow 0011 = Overflow (e) (+5) + (+4) (f) (-7) + (-6)
  • 17. Subtraction l S bt ti rules: Perform a bit-by-bit complement of the subtrahend and add the complemented subtrahend to the minuend with an initial carry in of 1 instead of 0.
  • 18. 0010 0101 + 1001 + 1110 1011 = -5 10011 = 3 (a) M = 2 = 0010 (b) M = 5 = 0101 S = 7 = 0111 S = 2 = 0010 -S = 1001 S -S = 1110 S
  • 19. 1011 0101 + 1110 + 0010 11001 = -7 0111 = 7 (c) ( ) M = -5 = 1011 5 (d) M = 5 = 0101 S = 2 = 0010 S = -2 = 1110 -S = 1110 -S = 0010
  • 20. 0111 1010 + 0111 + 1100 1110 = Overflow 10110 = Overflow (e) M = 7 = 0111 (f) M = -6 = 1010 S = -7 = 1001 7 S = 4 = 0100 -S = 0111 -S = 1100
  • 21. The Byte Nibble, and Word Byte, Nibble • 1 byte = 8 bits • 1 nibble = 4 bits • 1 word = size depends on d t pathway d i d d data th size. – Word size in a simple system may be one byte (8 bits) – Word size in a PC is eight bytes (64 bits)
  • 22. -Codes are group of special symbols used t C d f i l b l d to represent numbers, letters or words. 1- Binary codes for decimal numbers (BCD) y ( ) - Binary Coded Decimal (BCD) is another way to present decimal numbers in binary form. - BCD is widely used and combines features of both decimal and binary systems.
  • 23. - Each digit of a decimal is represented by its four bit four-bit binary equivalent (1 to 9) - To represent the decimal number 10 we need n mber e eight bits (0001 0000)
  • 24. • To convert the number 87410 to BCD 8 7 4 (decimal) 1000 0111 0100 (BCD) • Each digit always uses four bits. ac d g t a ways ou b ts. • The BCD value can never be greater than 9 • Reverse the process to convert BCD to decimal.
  • 25. • BCD i not a number system. is t b t • BCD is a decimal number with each digit encoded to its binary equivalent. equivalent • A BCD number is not the same as a straight binary number. number • The primary advantage of BCD is the relative ease of converting to and from decimal.
  • 26. Decimal Binary Octal Hexadecimal BCD 0 0 0 0 0 1 1 1 1 0001 2 10 2 2 0010 3 11 3 3 0011 4 100 4 4 0100 5 101 5 5 0101 6 110 6 6 0110 7 111 7 7 0111 8 1000 10 8 1000 9 1001 11 9 1001 10 1010 12 A 0001 0000 11 1011 13 B 0001 0001 12 1100 14 C 0001 0010 13 1101 15 D 0001 0011 14 1110 16 E 0001 0100 15 1111 17 F 0001 0101
  • 27. 2 2- American Standard Code for Information Interchange (ASCII) - It is a seven bit code. It has 27 possible code groups. - Represents characters and functions found on a computer keyboard. - Examples of use are: to transfer information between computers, between computers and printers, and f i i d for internal storage. l
  • 28. 3- 3 Gray code Two successive values differ in only one bit
  • 31. • 4- Codes for detecting and correcting errors • Error means corruption of data data. • - Parity Bit • - Hamming C d i Code
  • 32. Parity bit: It is an extra bit that is attached to a code group that is being transferred from one location to another. It is made either 0 or 1 Depending on the number of 1 that 1. di h b f 1s h are contained in the code group. Even parity: The value of the parity bit is chosen so that the total number of 1s including the parity 1s, bit, is an even number; 1 1000011
  • 33. Odd parity: The value of the parity bit is chosen so th t th t t l number of 1 i l di th that the total b f 1s, including the parity bit, is an odd number; 1 1000001
  • 34. Assignment (1) 1- Indicate whether or not overflow occurs when adding the following 8-bits 8 bits two’s complement numbers 00100110 + 01011010 (2.12 d textbok2) 2- 2-1.c (textbook1) 3- 2-11.c 4 2 19.c 4- 2-19.c 5- 2-24