[1] Data Representation

  • 21,680 views
Uploaded on

Unit 1 Data Representation from Computer Systems Unit of Higher Computing

Unit 1 Data Representation from Computer Systems Unit of Higher Computing

More in: Education , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
21,680
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
311
Comments
2
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Data Representation Represent! How information is stored in a Computer System With our resident Binary enthusiast … Brian Sup Homies! only 10 people understand binary Mr McAlpine Hamilton Grammar School
  • 2.
    • A computer is a two state machine (using only 1’s and 0’s to represent digits ‘on’ and ‘off’
    • Represented using voltage ( 1 – 5 volts is ON! 0 volts … surprise OFF!)
    • Binary System 1’s and 0’s
    • To + - * / fewer rules need to be built into processor
    • Drop in voltage - NO EFFECT
    • Easy to represent two stages in storage devices (presence of pits on a CD-ROM)
    Binary... Why do computers use it?
  • 3.
    • Use 1’s and 0’s to represent decimal numbers
    Binary... only ten people know it no ... wait ...
    • A BIT (1 OR 0) is the smallest unit of memory in a computer
    • 1 bit – 1 or 0 ( two different numbers )
    • 2 bits – 00, 01, 10, 11 ( four numbers )
    • 3 bits – 000, 001, 010, 011, 100, 101, 110, 111 – ( 8 different numbers )
  • 4. Are you getting it yet?
    • How many different numbers can you represent with?
      • 4 bits?
      • 5 bits?
      • 6 bits?
      • 8 bits?
    • Can easily work it out by …
    • Number of bits ^ 2
  • 5.
    • Taking an example using 8 bits
    • 256 individual combinations we can make
    What does it all mean?
    • 128 64 32 16 8 4 2 1
    0 0 0 0 0 0 0 0
    • Lowest number we can represent
    1 1 1 1 1 1 1 1
    • Highest number we can represent
    • We simply add up the numbers with a 1
    • 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
  • 6.
    • We want to represent the number 83 in binary
    • (there’s a couple of ways of working it out)
    the other way around
    • 128 64 32 16 8 4 2 1
    0 (coz 128 don’t fit!) 1 ( 64 fits, leaves 19 ) 0 1 (leaves 3 ) 0 0 Gives us 1 ( 1 left) 1 0 1 0 1 0 0 1 1
  • 7. Ok idiots, give this a go
    • Convert these from binary to decimal
    • 0110 0111
    • 1110 0011
    • 0101 0110
    • 1010 1100
    • Convert these decimals to binary
    • 255
    • 84
    • 172
    • 4
    • 128 64 32 16 8 4 2 1
  • 8. Challenge – 12 bits
    • Convert these from binary to decimal
    • 1001 0110 0111
    • 0101 1110 0011
    • 1011 0101 0110
    • 1101 1010 1100
    • 128 64 32 16 8 4 2 1
  • 9. Right, so that’s easy
    • Not great, it doesn’t let us represent
    • Negative Numbers
    • Fractions of numbers
    • Two’s Compliment
    • Floating Point Representation
  • 10. Two’s Compliment
    • Allows us to represent negative numbers
    • Need a way of recognising if a number is negative
    • Two’s Compliment does thus
    • Take positive binary number 0000 1010 +10
    • Invert all bits 1111 0101
    • ADD 1 ( 1 + 1 = 0, carry over) 1111 0110 -10
    • Anyone work out how you know if it’s a negative number?
  • 11. Remember!
    • To check which number representation we are using! If a question doesn’t tell you choose one yourself and write it down!
    • Convert to two’s compliment representation
    • -9
    • -45
    • -187
    • -283
  • 12. The good thing!
    • When we are trying to check what a number is in decimal we just repeat the process! (that’s why two’s compliment is so good)
    • What are these numbers in decimal?
    • 1000 1101
    • 1111 0110
    • 1010 1010
    • 1100 0011
  • 13. More good bits
    • We used to use a signed bit to represent a negative number
    • This reduce the number of bits available to represent the number
    • This would have reduced the range of numbers which could be represented
    • Computer Arithmetic was “Pure Mental”
  • 14.
    • 23.75 = 0.2375 * 10 ^ 2
    • 2375 – the mantissa
    • 2 – the exponent
    • The same thing in binary
    • Mantissa gives the number to be represented
    • The exponent gives how many places to “float” the decimal point
    Real Numbers! We've got negative, now fractions
  • 15. Real Numbers
    • Number 13.75
    • 8 4 2 1 0.5 0.25 0.125 0.0625
    • 1 0 1 1 1 0 0
    • Mantissa = 1101.1100
    • Exponent (need to move 4 decimal places)
    • 8 4 2 1
    • 0 1 0 0
    • Exponent = 0 1 0 0
    • 1101 1100 0100 (all we need)
  • 16. Increasing the M and the E
    • Increasing the mantissa
    • Giving more bits to represent a number would increase the precision
    • Think of a tape measure
    • (if there are more wee bits marking the distances you will get a more precise measurement)
  • 17. Increasing the M and the E
    • Increasing the exponent
    • This means that the range of the numbers is increased
    • 10 * small exponent = small number
    • 10 * big exponent (more bits) = bigger number
    Worksheet 1
  • 18. Questions and Reading
    • From the Walsh Book Read
    • Pages – 2 to 9
    • Questions (on page 20)
    • 1 2 3 4 5 6 7 8 9
    Worksheet 1
  • 19. Data Representation How text is represented/sent in a computer system ASCII Code UNICODE Memory Sizes Im the greatest Dancer!
  • 20.
    • A byte is space which is used to store a character ( 8 bits )
    • All the characters which can be represented are known as the character set
    • Each character to display is given a different code
    • ASCII is the most popular form
    • American Standard Code for Information Interchange
    Sending Text!
  • 21. What does it all mean?
    • What’s in a bit?
    • A 1 or a 0
    How should you remember it?
    • Kinder Bueno
    • 8 wee bits or one big Byte !
  • 22. Memory Sizes
    • Reminder
    • Big
    • Boys
    • Kicked
    • My
    • Granny
    • Twice
  • 23. Memory Sizes
    • Bit <- smallest
    • Byte
    • Kilobyte
    • Megabyte
    • Gigabyte
    • Terabyte <- biggest
  • 24.
    • A bit is the smallest unit of memory
    • There are 8 bits in a byte
    • There are 1024 bytes in a kilobyte
    • There are 1024 Kb in a Megabyte
    • There are 1024 Mb in a Gigabyte
    • There are 1024 Gb in a Terabyte
    Memories at the corner of my eye!
  • 25. Calculating Memory Sizes
    • We don’t say our broadband speed is
    • 33 million bits per second
    • 4 Megabytes
    • We don’t say our computer has
    • 687194767360 bits of memory
    • 80 Gigabytes
    • Calculating the correct sizes is a wee bit fidgety but you get used to it
  • 26. Calculating Memory Sizes
    • bits / 8
    • bytes / 1024
    • kilobytes / 1024
    • megabytes / 1024
    • gigabytes / 1024
    • terabytes
    • TAKE A NOTE
    Terabytes * 1024 Gigabytes * 1024 Megabytes * 1024 Kilobytes * 1024 Bytes * 8 bits TAKE A NOTE Worksheet 3
  • 27. ASCII Code
    • ASCII is a 7 bit code which allows 128 characters
    • Extended ASCII allows 8 bits or 256 characters
    • Used to represent text although some characters don’t print
    • 0 – 31 are what is known as control characters
    • Carriage Return, Tab, Clear Screen for example
  • 28. UNICODE
    • What about the CODES that ASCII cannot represent? The Japanese for example
    • UNICODE is a 16 bit code which is used to represent a lot more characters
    • ASCII uses less memory (7 bits)
    • UNICODE capable of representing a lot more characters
  • 29. ASCII Code
    • 65 in decimal = A
    • 66 = B
    • 67 = C and so on and so forth
    • We can code messages and understand what they say etc
    • I intercepted a nasty text from Mr Arthur to Mr McGowan help me out a bit
    • Have a bash at working out this message
    Worksheet 2
  • 30. Data Representation Graphics How are Graphics stored in a Computer System Calculating memory requirements These glasses are X-Ray
  • 31.
    • Graphics are made up of tiny dots called PIXELS each requiring one bit
    • Picture Elements 49 bits memory. WHY?
    GRAPHICS!
  • 32. Resolution
    • A screen display of 800 x 600 is smaller is resolution
    • 1024 x 768 is higher resolution
    • Two types of Graphic
    • Bit mapped
    • Vector
  • 33. Resolution
    • A screen display of 800 x 600 is smaller is resolution
    • 1024 x 768 is higher resolution
    • Two types of Graphic
    • Bit mapped
    • Vector
    • These store the graphics in different ways
  • 34. Bit Mapped
    • Think about Paint
    • When you draw a shape on top of another it rubs out anything on the bottom
    • It has a fixed resolution (which means your image is rubbish when printed!)
    • You can zoom in and edit individual pixels
    • It saves the full screen – even if there’s nothing on there!
  • 35. Vector Graphics
    • Keeps shapes as separate objects
    • Saves attributes of objects rather than all pixels – less memory requirements
    • Resolution Independence – prints at the full resolution available on printer
    • Can edit all the individual objects which make up the graphic, but not the individual pixels
  • 36. Backing Storage Requirements This image of screech measures 2 inches by 2 inches. It has a resolution of 80 dpi using 256 colours Memory Required Total Pixels (2 * 80) * (2 * 80) = 25, 600 Each pixel could be one of 256 different colours 256 requires 8 bits 25,600 * 8 = 204, 800 bits 204, 800 = 25,600 bytes or 25 kilobytes
  • 37. Your Turn This idiots picture measures 3 inches by 2 inches It has a resolution of 150 dots per inch. It uses TRUE COLOUR which uses 24 bits per pixel 395.5 Kilobytes Worksheet 4
  • 38. Data Representation The need for Compression Different methods of Compression Compress Yourself!
  • 39. Data Compression
    • Compression simply means reducing the size of a file in order to save some space
    • Two different types
    • Lossy
    • Lossless
  • 40. Lossless Compression
    • Means that none of the original data is lost
    • Counting repeating pixels is one method
    • This means you can save
      • Store what colour pixel is
      • How many are repeated in a row
      • Saves a lot of memory
  • 41. Lossy Compression
    • Means you sacrifice some data to reduce the file size
    • Using complex mathematical coding
    • Ditching stuff our eyes cant see
    • Can reduce size more than lossless
    • But, only if it doesn’t make the file useless
    Worksheet 5
  • 42. Advantages of Compression
    • Bit maps use up a lot of backing storage
    • Compression saves a lot of it
    • The less space it takes up the less time it takes to transfer it in an email etc
    • Takes less time to load up in a web browser
  • 43. Disadvantages of Compression
    • If Lossy compression is used then detail may be lost from the images
    • Can alter the images introducing things that weren’t there
    • Take a lot of time to compress a very large image
    • Repeated compression can alter and affect the image
  • 44. And here it ends
    • That’s everything in Section 1: Data Representation
    • What you need to do now:
    • Read Scholar for more in depth information
    • Read Walsh for the same
    • Practice loads of questions (Walsh Book)
    • Study for end of section test