1 / 14

Data Types and Representation

Data Types and Representation. CS French Chapter 6 + Chapter 7 – Number Bases. Data Processing. Data eg ESB meter readings. Processing by Computer. INFORMATION eg bills. Maintained Data eg names, addresses, account numbers, last meter reading, amount already owed.

xenon
Download Presentation

Data Types and Representation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. Scientific Processing • Data • 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 • Data is represented by the character set • 0..9,a...z,A....Z, !”£$%.()~ etc • Character Types • Numeric 0...9 • Alphabetic (upper and lower case) • Special • Data Types • Numeric • signed/unsigned integers, real, fised / floating point • Alphabetic • Alphanumeric

  5. Data Representation for Computer Devices • 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 • 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 • 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. • 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. Binary Code 00100000 00100001 00110110 00110111 01000001 01000010 01100001 ASCII Character SPACE ! 6 7 A B a Some ASCII Codes How many possible characters can be represented with 8 bits?

  8. Data Transmission 0 5 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. 1v 5v

  9. Pulse Train for ASCII ‘K’ Voltage 5 1 0 1 0 0 1 0 1 1 Time 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 1st year course) • 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 fours ones 1x1 = 1 0x2 = 0 1x4 = 4 1x8 = 8 Total 13 Binary to decimal: 1 1 0 1 eights twos Decimal to binary: 2 21 2 10 1 2 5 0 2 2 1 2 1 0 2 0 1 leftovers 21 = 10101

More Related