Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Types and Representation CS French Chapter 6 + Chapter 7 – Number Bases.

Similar presentations


Presentation on theme: "Data Types and Representation CS French Chapter 6 + Chapter 7 – Number Bases."— Presentation transcript:

1 Data Types and Representation CS French Chapter 6 + Chapter 7 – Number Bases

2 Data Processing Data eg ESB meter readings Maintained Data eg names, addresses, account numbers, last meter reading, amount already owed. Processing by Computer INFORMATION eg bills

3 Scientific Processing n Data n eg current weather conditions Processing by Computer Large amount of calculations of changes over small distances and time periods. INFORMATION description of tomorrow’s weather

4 Basic Data Types n Data is represented by the character set –0..9,a...z,A....Z, !”£$%.()~ etc n Character Types –Numeric 0...9 –Alphabetic (upper and lower case) –Special n Data Types –Numeric »signed/unsigned integers, real, fised / floating point –Alphabetic –Alphanumeric

5 Data Representation for Computer Devices n Punched Paper tape (obsolete) 7 8 9 0 a b c d e f g h i j k l m n o p This tape is using the ASCII coding system.

6 Binary Devices n Punched tape can be replaced by any device that contains items that can be set to any one of two positions.  Magnetic tape/disc –spots can be magnetised one direction NORTH or the other SOUTH  Transistors –Electronic switches that can be ON or OFF  Charged cells –An electronic device that can have a NEGATIVE or POSITIVE charge  Reflective surface (CD) –Spots on the disc may REFLECT a thin laser light or NOT REFLECT it n These devices are called Binary devices (or two state devices) because when writing the data on paper we can use the digits 1 and 0 to represent the two states. n A single piece of information is called a BIT (Binary digIT) –One item in the device is required to store a bit (a switch, a hole, a magnetic spot, a reflective spot etc.)

7 Some ASCII Codes Binary Code 00100000001000010011011000110111010000010100001001100001 ASCII Character SPACE!67ABa How many possible characters can be represented with 8 bits?

8 Data Transmission 1v5v 5 0 1 Could you use this electrical circuit and the ASCII code system to send a message? Use the 5 volt position to represent 1 and the 1 volt position to represent 0. The person at the other end will see a series of bright and dim lights which can be interpreted as ones and zeros and which can then be translated into characters using the ASCII table. Why is the 0 volt position in the switch necessary? If you are transmitting 2 ones or zeros consecutively you can momentarily switch the light off to distinguish between them. Or if you used 0 volts to represent 0 you wouldn’t be able to tell the difference between a 0 being transmitted and ‘no signal’ being transmitted.

9 Pulse Train for ASCII ‘K’ Time Voltage 1 5 0 1 0 0 1 0 1 1 If you measured the voltage in the wire and graphed how it changed over time. What is the advantage of having each bit the same length? You don’t have to break the signal between 2 ones or zeros.

10 Parity (not required for 1 st year course) n An extra bit is added to each code if required in order to ensure there is an ODD number of 1’s in the code.(odd parity) 7 8 9 0 a b c d e f g h i j k l m n o p You can also use even parity Used to detect errors in data storage or transmission

11 Bit Mapped Images

12 Digitised Sound Sampling : a voltage generated by the sound vibrations in a sensor (eg. Microphone) is recorded as numbers at discrete intervals. Reconstructed sound: the sound wave form can be recreated from the recorded numbers. Notice there is a loss of detail between the measurements.

13 Chapter 7: Number Bases Decimal Octal Hexadecimal Binary Think about how you count! It is easier to convert from binary to octal or hexadecimal than to decimal!

14 Conversions Binary to decimal: 1 1 0 1 ones twos fours eights 1x1 = 1 0x2 = 0 1x4 = 4 1x8 = 8 Total 13 Decimal to binary: 2 21 2 10 1 2 5 0 2 2 1 2 1 0 2 0 1 leftovers 21 = 10101


Download ppt "Data Types and Representation CS French Chapter 6 + Chapter 7 – Number Bases."

Similar presentations


Ads by Google