Presentation is loading. Please wait.

Presentation is loading. Please wait.

National 4 and National 5 Computer Science. National 4 Computing Science 2 units: Software Design and Development Information System Design and Development.

Similar presentations


Presentation on theme: "National 4 and National 5 Computer Science. National 4 Computing Science 2 units: Software Design and Development Information System Design and Development."— Presentation transcript:

1 National 4 and National 5 Computer Science

2 National 4 Computing Science 2 units: Software Design and Development Information System Design and Development 2 Outcomes for each unit Additional Value Unit

3 National 5 Computing Science 2 units: Software Design and Development Information System Design and Development 2 Outcomes for each unit Coursework Assessment (40%) Exam (60%)

4 Software Design and Development Topics include: How computers store information Program Design Programming How computers work

5 Information System Design and Development Topics include: Databases Websites (understanding and creating) Testing Hardware, Software, Storage and Networking Security Legal and Environmental Issues

6 Computing Science in Springburn Academy Topics from each unit (SDD and ISDD) will be taught in logical groups Outcomes will be completed after teaching and learning of related topic(s) AVU or Coursework sections will be completed after teaching and learning of related topic(s)

7 National 4 and National 5 Computer Science Low-level operations and computer architecture (SDD) Media Types (ISDD)

8 Low level operations and computer architecture National 4 Use of binary to represent and store: positive integers characters instructions (machine code) Units of storage (bit, byte, Kb, Mb, Gb, Tb, Pb) National 5 Translation of high-level program code to binary Comparison of interpreters and compilers Binary to represent positive integers Decimal Binary Floating point numbers ASCII Vector and Bitmap graphics Computer architecture components

9 Media Types National 4 Sound, graphics, video, text National 5 Standard file formats and their benefits: Text: txt, rtf Audio: wav, mp3 Graphics: jpeg, gif, png, svg Video: mp4, avi Factors affecting file size and quality File size for colour bitmaps Need for compression

10 Learning Intention I will learn how computers store numbers and how to convert them into decimal values

11 The two state machine Computers and storage devices (hard drives, USB flash drives, CD ROMS, DVDs) have components that only have two states:- On and Off 1 represents On 0 represents Off

12 The Decimal and Binary Systems We use the decimal or base 10 system in normal life: This means we have 10 digits: 0-9 Computers use the binary or base 2 system: There are two digits: 0 and 1 Each figure is known as a bit (binary digit) we don’t mean numbers with a dot (.) in them

13 Decimal Numbers Look at how a decimal number is made up: e.g. 273 273 = (2 x 100) + (7 x 10) + (3 x 1) Hundreds 10 3 = 100 Tens 10 2 = 10 Units 10 1 = 1 273

14 Binary Numbers The column heading for binary are: 2 7 128 2 6 64 2 5 32 2 4 16 2382382 224224 212212 201201

15 Converting Binary to Decimal Lets look at how 173 is stored in binary: = (1 x 128) + (1 x 32) + (1 x 8) + (1 x 4) + (1 x 1) = 128 + 32 + 8 + 4 + 1 = 173 1286432168421 10101101

16 Steps to convert from Binary to Decimal 1.Write the binary column headings 2.Write the binary number below the headings 3.Add the column headings that have a 1: 64 + 32 + 8 + 2 = 106 1286432168421 1286432168421 01101010

17 Try these: Convert from Binary to Decimal: 00001110 00101011 01111001 =8+4+2=14 =32+8+2+1=43 =64+32+16+8+1=121

18 Success Criteria I know how computers store numbers and can convert from binary to decimal.

19

20

21 Learning Intention I will learn how to convert from decimal into binary.

22 Converting Decimal to Binary Let’s look at how to write the decimal value 145 in binary: = 128 + 16 + 1 = 145 1286432168421 10010001

23 Steps to convert from Decimal to Binary E.g. for the Decimal number 89 1.Write the column headings 2.Is the column heading 128 bigger than the number you want to convert? Yes put a 1. No put a 0. 1286432168421 1286432168421 0

24 Steps to convert from Decimal to Binary (cont) E.g. for the Decimal number 89 3.Is the column heading 64 bigger than the number you want to convert? Yes put a 1. Subtract 64 from number: 89 – 64 = 23 1286432168421 01

25 Steps to convert from Decimal to Binary (cont) E.g. for the Decimal number 89 4.Is the column heading 32 bigger than the number you want to convert? (currently 23) No put a 0. 5.Repeat the process for 16,8,4,2 and 1 1286432168421 010

26 Steps to convert from Decimal to Binary (cont) E.g. for the Decimal number 89: 128 – No, 64 – Yes: 89 – 64 = 23, 32 – No, 16 – Yes: 23 – 16 = 7, 8 – No, 4 – Yes: 7 – 4 = 3, 2 – Yes: 3 – 2 = 1, 1 – Yes: 1 – 1 = 0 1286432168421 01010111

27 Try these: Convert from Decimal to Binary: 15 73 114 212 1286432168421 00001111 01001001 01110010 11010100

28 Success Criteria I can convert from decimal into binary.

29 Learning Intention I will learn how computers store real numbers

30 Storing real numbers Computers need to be able to store real numbers, not just whole numbers These are stored using floating point representation. In maths you would store a number in base 10 such as 18.25 as follows in standard form: 0.1825 x 10 2 m x 10 e mantissa exponent

31 Storing real numbers (cont) Computers store floating point numbers using a mantissa and exponent too m x 2 e 1.First convert the decimal number into binary. E.g. 18.25 168421.0.50.25 10010.01

32 Storing real numbers (cont) 2.Then need to move the number right: 10010.01 =.1001001 x 2 5 =.1001001 x 2 101 101 is 5 in binary So decimal 18.25 is 1001001 101 in binary mantissa exponent

33 Storing real numbers (cont) Using mantissa and exponent to store floating point numbers: Advantage – extremely large and extremely small numbers can be stored using small number of bits Disadvantage – stored number not 100% accurate as mantissa is rounded off

34 Success Criteria I can describe how computer store real numbers.

35 Learning Intention I will learn how computers store text

36 Storing Text Computers use binary to store characters A character is a letter, number or symbol from the keyboard. Characters include: digits (0-9) – numeric characters letters (A-Z,a-z) – alphabetic characters punctuation (,. etc) – special characters

37 Storing Text (cont) A computer needs to be able to represent all the characters we want to use. The list of all characters a computer can process and store is called the character set. Each character is given a unique code number.

38 Storing Text (cont) Most popular form of code is ASCII (ask-eee) – American Standard Code for Information Interchange. ASCII is a 7 bit code Uses 2 7 different codes = 128 different codes. E.g. 1000001 = 65 = A 1000010 = 66 = B If more codes are needed then 2 8 different codes are used by extended ASCII. This allows codes for characters such as ©, ë, ½

39

40 Storing Text (cont) 128 (or even 256) characters is not enough to include the characters from languages such as Japanese Unicode character set used to store these The first 128 characters in Unicode are the same as first 128 characters in ASCII 16 bit Unicode can store 65536 (2 16 ) characters

41 Success Criteria I can convert from text to binary and vice-versa.

42 Learning Intention I will learn how to represent computer memory sizes using the correct units.

43 Units of Storage A single bit can store either a 0 or a 1 Storing more data, like a document or a song takes thousands or millions of bits. How much storage does your mobile phone have?

44 Units of Storage (cont) bit = a single 0 or 1 byte = 8 bits Kilobyte (Kb) = 1024 bytes Megabyte (Mb) = 1024 Kilobytes Gigabyte (Gb) = 1024 Megabytes Terabyte (Tb) = 1024 Gigabytes Petabyte (Pb) = 1024 Terabytes Why 1024 and not 1000? 1024 = 2 10

45 Units of Storage (cont) Real Names bits bytes Kilobytes (Kb) Megabytes (Mb) Gigabytes (Gb) Terabytes (Tb) Petabytes (Pb) Memory Aid Big Boys Kicked My Granny Twice Punks

46 Units of Storage (cont) bits bytes Kilobytes (Kb) Megabytes (Mb) Gigabytes (Gb) Terabytes (Tb) Petabytes (Pb) 8 1024 ÷

47 Units of Storage (cont) bits bytes Kilobytes (Kb) Megabytes (Mb) Gigabytes (Gb) Terabytes (Tb) Petabytes (Pb) 8 1024 x

48 How many? How many bits in 4 bytes? How many bytes is 1024 bits? How many kilobytes in 2 megabytes?

49 Worked Example #1 A sports tracker wristband has 2 Megabytes of memory. How many bits of information can it store? 2 Megabytes = 2,048 kilobytes (2 x 1024) = 2,097,152 bytes (2048 x 1024) = 16,777,216 bits (2,097,152 x 8)

50 Worked example #2 My smartphone has a memory size of 16,777,216 Kilobytes. How many Gigabytes is this? 16,777,216 Kilobytes = 16, 384 Megabytes = 16 Gigabytes /1024

51 Worked example #3 A 5 minute mp3 song file is 13,260,000 bytes in size. How many Megabytes is this? 13,260,000 bytes = 12,949.22 Kilobytes = 12.65 Megabytes /1024

52 Units of Storage (cont) bit 8 byte 1024 Kilobyte (Kb) 1024 Megabyte (Mb) 1024 Gigabyte (Gb) 1024 Terabyte (Tb) 1024 Petabyte (Pb) x ÷

53 Success Criteria I can convert computer storage sizes into the appropriate units of measurement.

54 Extension Task Create a PowerPoint presentation which has one slide for each of the units (bit, byte etc) details that unit in relation to the smaller unit next to it (i.e. byte = 8 bits, kilobyte = 1024 bits) includes some details about what you could store using that amount of space (e.g. If you had only 1 KB of memory what could you do with it?)

55 Starter Task Complete the worksheet on your desk.

56 Learning Intention I will learn how a computer stores graphics

57 Computer Graphics Computers graphics on the screen are made up of tiny dots called pixels (picture element) Computers store graphics in two different ways – either as vector graphics or as bitmap graphics.

58 Vector Graphics Vector graphics are made up of lots of overlapping shapes. Each shape can be edited independently from the other shapes.

59 Storing Vector Graphics Vector graphic files are stored by storing attributes (or qualities) about each of the shapes in the picture. E.g. for the rectangle in this image: Length Breadth Edge colour Edge thickness Fill colour Start X, Start Y Rotation

60 Storing Vector Graphics (cont) Overlapping vector graphics objects can be separated again. When you save a vector graphics file, only the objects are saved, not the whole page. Vector graphic files are small in size.

61 Bitmap Graphics Bitmap graphics are made up of lots of individual pixels.

62 Bitmap Graphics A bitmap image stores details for every individual pixel Can change an individual pixel at a time Look at this black and white image: 0 stored for white. 1 stored for black. Each black and white pixel takes 1 bit of storage.

63 Resolution Resolution is the name given the amount of pixels that the image is made of Also used to describe the number of pixels displayed on the screen Higher resolution = clearer and more detailed picture = larger file size 8 x 8 16 x 16

64

65 Vector Graphics – Pros and Cons Advantages Do not lose quality when scaled Require less storage space Objects are easily moved/manipulated Disadvantages Cannot be edited at pixel level Cannot show photo realistic scenes Usually require specialist applications to open the files

66 Bitmap Graphics – Pros and Cons Advantages Can edit pixel by pixel Can represent photo-realistic scenes Wide array of graphic effects can be applied Disadvantages Image becomes jagged when scaled Large file size

67 Success Criteria I can describe how vector and bitmap graphics are stored.

68 Learning Intention I will learn how to calculate the storage space required for black and white bitmaps

69 Calculating Bitmap Graphics Storage Black and White Each pixel in a black and white image needs 1 bit of storage. Steps to calculate storage space required: 1.Amount of pixels wide x Amount of pixels high (this answer is in bits) 2.Convert the number of bits into the appropriate units (Kilobytes, Megabytes – divide until appropriate)

70 Calculating Bitmap Graphics Storage Black and White – Example How much storage space is required to store a black and white image which is 800 pixels by 900 pixels? Step 1: width x height = 800 * 900 = 720,000 bits Step 2: 720,000/8 = 90,000 bytes 90,000/1024 = 87.89 Kilobytes

71 Calculating Bitmap Graphics Storage Black and White – try it 1.How much storage space is required to store a black and white High Definition image which is 1920 pixels by 1080 pixels? 1920 x 1080 = 2073600 bits /8 = 259200 bytes /1024 = 253.13 kilobytes

72 Calculating Bitmap Graphics Storage Black and White – Alternative Question Sometimes you will be told the image size and the resolution of the image. e.g. image is 5 inches by 5 inches and has a resolution of 200 dpi. DPI = Dots Per Inch = amount of pixels across one inch of the image 200 pixels (or dots) 1 inch square 200 pixels (or dots)

73 Calculating Bitmap Graphics Storage Black and White – try it How much storage space is required to store a black and white image 3 inches by 4 inches with a resolution of 250dpi (dots per inch)? (3 x 250) x (4 x 250) = 750000 bits /8 = 93750 bytes / 1024 = 91.55 kilobytes

74 Success Criteria I can calculate the storage requirements for a black and white bitmap image

75 Learning Intention I will learn how to calculate the storage space required for colour bitmap images

76 Calculating Bitmap Graphics Storage Colour Black and white image = two colours = 1 bit per pixel as 2 1 = 2 More than 1 bit is allocated to each pixel for colour images: 2 bits/pixel = 2 2 = 4 colours 3 bits/pixel = 2 3 = 8 colours 4 bits/pixel = 2 4 = 16 colours 8 bits/pixel = 2 8 = 256 colours

77 Calculating Bitmap Graphics Storage Colour (cont) Number of bits allocated to each pixel is known as the bit depth. An image with 16 bit colour depth could have 65536 different colours (2 16 ) True colour 24 bit colour depth: 2 24 = 16,777,216 colours 8 bits for each of Red, Green and Blue (RGB)

78 Increasing Bit Depth / Colour Depth Higher Bit Depth = More Colours But file size increases

79

80 Calculating Bitmap Graphics Storage Colour – Example How much storage space is required to store a colour image which is 400 pixels x 300 pixels and has a colour depth of 16? Step 1: width x height x colour depth = [resolution] x colour depth = [400 x 300] x 16 = 1,920,000 bits Step 2: 1,920,000/8 = 240,000 bytes 240,000/1024 = 234.38 Kilobytes

81 Calculating Bitmap Graphics Storage Sometimes you will be told the image size and the resolution of the image. e.g. image is 5 inches by 5 inches and has a resolution of 200 dpi. DPI = Dots Per Inch = amount of pixels across one inch of the image 200 pixels (or dots) 1 inch square 200 pixels (or dots)

82 Calculating Bitmap Graphics Storage Colour – try it 2.How much storage space is required to store a 10 bit colour image 3 inches by 4 inches with a resolution of 150dpi (dots per inch)? [resolution] x [bit depth] (3 x 150) x (4 x 150) x 10 = 2700000 bits /8 = 337500 bytes / 1024 = 329.59 kilobytes

83 Success Criteria I can calculate the storage requirements for a colour bitmap image.

84 Media Types Computers use a range of media or data types including sound (also called audio), graphics, video and text.

85 Media Types Multimedia is the presentation of information by a computer using these media types. Graphic, Video and Audio files can be very large in size so compression is needed.

86 Compression Compression reduces the size of files and therefore reduces the time to transfer them across networks.

87 Types of Compression Lossless (no loss) compression does not affect the quality of the file Lossy compression:- results in a file of poorer quality than the original results in smaller files than lossless compression Can result in artefacts (flaws) appearing in JPEGs

88 Artefacts – flaws due to compression

89 Standard File Formats Standard File Formats are used to store files so that the files can be used in a different application package from the one which created it.

90 Text Files – TXT (Text) Used to store a plain text file. TXT files store an ASCII code for each character TXT files contain no formatting information e.g. bold, italic, font, alignment etc

91 Text Files – RTF (Rich Text Format) A complex format used to store data from a word processing application. Can be used to transfer data between different word processing applications without losing the format. Stores text data and formatting information e.g. bold, italic, alignment, font

92

93 Starter Questions Discuss with your neighbour and be ready to answer if asked to: 1.Describe two factors which affect the file size of a colour image? 2.What is lossy compression? 3.What is lossless compression?

94 Graphics Files - BMP Windows Bit-Mapped image file format Files are large – no compression Colour depth between 1 and 64 bits 24-bit colour depth most common (16.7 million colours)

95 Graphics Files – GIF Graphics Interchange Format Compressed using lossless compression GIF files may be interlaced – low quality version can be shown while rest of file downloads

96 Graphics Files – GIF (cont) Supports animation - multiple images in one GIF file Supports one transparent colour Colour depth of 8-bit (256 colours) Good for cartoon like images

97 Graphics Files - JPEG Joint Photographic Expert Group Lossy compression – amount of compression is adjustable – allows higher quality but takes more storage JPEG format good for natural real life images Does not support transparency or animation Supports 16.7 million colours (24-bit colour depth)

98 Graphics Files – PNG Portable Network Graphics Includes all the advantages of GIFs but without the limitations Uses lossless compression Up to 48 bit colour depth Allows partial transparency

99 Graphics Files – SVG Scalable Vector Graphics Stores objects as a list of attributes e.g. fill, x1, y1, colour No compression Does not lose quality when scaled Supports layers

100

101 How Audio is stored Microphone used to capture sound Computer regularly measures the amplitude (change over time) of the sound wave and stores this in a file

102 Audio - Sampling Rate Sound is analogue Computer system changes it to a digital signal by sampling (measuring the sound wave and storing the measurement as a digital number) The sampling rate is the number of times per second that the sound wave is measured CD quality sound is sampled at 44.1KHz = 44,100 time per second

103 Audio - Sampling Rate Higher sampling rate = better quality sound = bigger file size

104 Audio Files - WAV WAVeform audio file format WAV is the standard format for storing sound files on Windows systems. Uncompressed, therefore large file size Used for high quality sound

105 Audio Files – MP3 Created by Motion Pictures Expert Group MP3 is a file format for compressing sounds CD quality sound Uses lossless compression – compresses file but keeps quality removes sound human ears cannot hear quiet sounds when a loud sound happens at the same time file size reduced to 10% of original size

106 Factors Affecting Sound File Size Length of sound file (number of seconds) Sampling rate

107

108 Video – MP4 Motion (Moving) Picture Expert Group MPEG is a container file – contains both audio and video MP4 uses lossy compression to reduce file size

109 Video – AVI Audio Video Interleave AVI is a container file No compression so files are large Usually associated with Windows computer systems

110 Factors affecting video file size Video resolution Bit depth (# of colours) of video Length of video (seconds) Frames per second (fps)

111

112 PDF (Portable Document Format) Developed by Adobe – open standard in 2008 Allows sharing documents independently of application software, hardware and operating system PDF files can contain text, graphics, video, audio and clickable links

113 Success Criteria I can describe the different standard file formats, why we use standard file formats and the factors affecting size and quality


Download ppt "National 4 and National 5 Computer Science. National 4 Computing Science 2 units: Software Design and Development Information System Design and Development."

Similar presentations


Ads by Google