Number Systems and Programming - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Number Systems and Programming

Description:

... Systems and Programming. Data and Computers -all data used by computers ... Computers operate in binary; data is manipulated as collections of individual bits. ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 16
Provided by: Gues422
Category:

less

Transcript and Presenter's Notes

Title: Number Systems and Programming


1
Number Systems and Programming
  • Data and Computers
  • -all data used by computers is stored as bits
  • -each bit is either a 0 or 1 Binary Code.
  • -Computers operate in binary data is manipulated
    as collections of individual bits.
  • -8 bits 1 byte
  • -1 byte can represent numbers from 0 to 255.
  • -Bytes can be combined to represent larger
    numbers.

2
High-level languages
  • When writing programs in high-level languages
    such as Turing, the base 10 number is used for
    convenience.
  • Before the computer can use these numbers, they
    must be converted into binary form.

3
Low-level languages
  • Machine language and assembly Binary (base 2) or
    hexadecimal (Base 16)
  • 4 binary digits 1 hexadecimal digit
  • Hexadecimal Code
  • 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
  • Octal System (Base 8)
  • 0,1,2,3,4,5,6,7

4
Character Presentation System
  • System required that can represent all letters,
    digits and special symbols.
  • Presentation system must be agreed upon by all
    computers.

5
ASCII baby!
  • American Standard Code for Information
    Interchange
  • 7 bits 128 symbols where
  • A 65 100001
  • A97

6
ANSI
  • American National Standards Institute
  • 8 bits256 symbols
  • First 128 are the same as ASCII
  • Handles special characters in French and other
    European languages.

7
EBCDIC
  • Extended Binary Coded Decimal Interchange Code
  • 8 bit system used on IBM mainframe computers
  • Can only handle standard characters

8
Unicode
  • Universal Code
  • 16 bit code
  • Handles 65,536 symbols
  • Handles all world languages

9
Binary Mathbinary addition
  • 0 0 0
  • 0 1 1
  • 1 0 1
  • 1 1 10

10
Binary Subtraction
  • Direct method
  • 0 0 0
  • 1 0 1
  • 1 1 1

11
Binary subtraction
  • 2s complement and Add 1
  • 101 101
  • -100 0111 100
  • ------- -------
  • 1001
  • ------- -------

12
Multiplying in Binary
  • 0 0 0
  • 0 1 0
  • 1 0 0
  • 1 1 1
  • 10001 11110 111111110
  • Try it

13
Dividing in Binary
  • 1/1 1
  • 0/1 0
  • 1/0 undefined
  • 0/0 undefined

14
Go to Assignment 6
  • Please provide a problem definition, a flowchart
    and the code in Turing for the Number Converter
    program.
  • May the programming force be with you.
  • The end

15
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com