Welcome to IGCSE Computer Science at Royal British International School!
Welcome to our IGCSE Computer Science page. On this page you will find curriculum content, course materials, worksheet, homework exercises, videos, IGCSE past papers and much more, all related to IGCSE Computer Science at RBIS.
Welcome Students and Parents to our IGCSE Computer Science page!
I am Mr. Myat Thu, an experienced teacher for international students and have attended many professional development programs and training from the US, UK, China, Singapore, Malaysia, Thailand within 29 years of a teaching career. I have also participated as a team leader for the Southeast Asia Students Activities, Competitions, SEASAC, almost every year. This year I will be teaching Mathematics, Computer Science, and Information Communication Technology for IGCSE classes.
I received my bachelor's degree, B.Sc.(Physics) from Yangon University in 1979 and a master's degree, M.Sc.(NuclearPhysics) in 1985. Then I continued to study computer science and received IDCS, the international diploma in computer studies in the year of 1995 and HDCS, the international higher diploma in 1996. Then I had taken the advanced diploma in Computer Studies exam from Singapore in 1996 and obtained an ADCS computer diploma. If you want to contact me, use this site any time or here is my contact detail:
Address: No(7) Hnin Cherry Street, Snow Garden, Thingangyun Township.
Email: [email protected]
I am Mr. Myat Thu, an experienced teacher for international students and have attended many professional development programs and training from the US, UK, China, Singapore, Malaysia, Thailand within 29 years of a teaching career. I have also participated as a team leader for the Southeast Asia Students Activities, Competitions, SEASAC, almost every year. This year I will be teaching Mathematics, Computer Science, and Information Communication Technology for IGCSE classes.
I received my bachelor's degree, B.Sc.(Physics) from Yangon University in 1979 and a master's degree, M.Sc.(NuclearPhysics) in 1985. Then I continued to study computer science and received IDCS, the international diploma in computer studies in the year of 1995 and HDCS, the international higher diploma in 1996. Then I had taken the advanced diploma in Computer Studies exam from Singapore in 1996 and obtained an ADCS computer diploma. If you want to contact me, use this site any time or here is my contact detail:
Address: No(7) Hnin Cherry Street, Snow Garden, Thingangyun Township.
Email: [email protected]
cambridge_igcse_computer_science.pdf | |
File Size: | 23279 kb |
File Type: |
You can download the Cambridge IGCSE Computer Science Text book pdf file from the above link.
Computer Science
Section 1: Theory of computer science
1. Binary system and hexadecimal (page 1-13)
Computer Science Chapter 12 Python Program.
import array ConstNoStudents = int(2) HighestMarkTest1=0 HighestIndexTest1=0 HighestMarkTest2=0 HighestIndexTest2=0 StudentMarkTest = array.array("i",range(ConstNoStudents+1)) StudentName= [ ] StudentGender= [ ] Outstanding1=[] Outstanding2=[] Test1 = [ ] Test2 = [ ] for Counter in range(1, ConstNoStudents +1): StudentName.append(input("Please Enter Student Name ")) a=True while a: StudentGender.append(str(input("Please Enter Student Gender: M or F "))) if (StudentGender != 'M'): print (StudentGender) a=False num1=int(input("Please Enter Mark for Test 1 ")) Test1.append(num1) num2=int(input("Please Enter Mark for Test 2 ")) Test2.append(num2) if(num1>HighestMarkTest1): HighestMarkTest1=num1 HighestIndexTest1=Counter Outstanding1=StudentName if(num2>HighestMarkTest2): HighestMarkTest2=num2 HighestIndexTest2=Counter Outstanding2=StudentName print(" ") next for Counter in range(0, ConstNoStudents): print (StudentName[Counter]) print (Test1[Counter]) print (Test2[Counter]) next print ("The highest marks of test 1 is: ",HighestMarkTest1) print ("The name is: ",Outstanding1[HighestIndexTest1-1]) print ("The highest marks of test 2 is: ",HighestMarkTest2) print ("The name is: ",Outstanding2[HighestIndexTest2-1]) |
Section 2: Practical problem solving and programming 9. Problem solving and design (Page. 115-133)
You can download text book pdf file here
|
Section 1 Theory of computer science
Chapter 1: Binary systems and hexadecimal.
Denary number is based on 10 number system and binary number is based on 2 number system ( 0 and 1).
Chapter 1: Binary systems and hexadecimal.
Denary number is based on 10 number system and binary number is based on 2 number system ( 0 and 1).
Activity 1.1
We have to use 2^0=1, 2^2=4, 2^3=8, 2^4=16, 2^5=32, 2^6=64 and 2^7=128.
a. 00110011
0 0 1 1 0 0 1 1
0 x 2^7+ 0 x 2^6+ 1 x 2^5+ 1 x 2^4 + 0 x 2^3 +0 x 2^2 +1 x 2^1 + 1 x 2^0.
0 + 0 + 32 + 16 + 0 + 0 + 2 + 1
32+16+2+1 = 51
b. 01111111
0 1 1 1 1 1 1 1
0 + 64+32+16+8+4+2+1 = 127
c. 10011001
1 0 0 1 1 0 0 1
128+0+0+16+8+0+0+1 = 153
d. 01110100
0 1 1 1 0 1 0 0
0+64+32+16+0+4+0+0 = 116
We have to use 2^0=1, 2^2=4, 2^3=8, 2^4=16, 2^5=32, 2^6=64 and 2^7=128.
a. 00110011
0 0 1 1 0 0 1 1
0 x 2^7+ 0 x 2^6+ 1 x 2^5+ 1 x 2^4 + 0 x 2^3 +0 x 2^2 +1 x 2^1 + 1 x 2^0.
0 + 0 + 32 + 16 + 0 + 0 + 2 + 1
32+16+2+1 = 51
b. 01111111
0 1 1 1 1 1 1 1
0 + 64+32+16+8+4+2+1 = 127
c. 10011001
1 0 0 1 1 0 0 1
128+0+0+16+8+0+0+1 = 153
d. 01110100
0 1 1 1 0 1 0 0
0+64+32+16+0+4+0+0 = 116
1.2. Converting from binary to denary
|
|
1.3. Converting from binary to denary.
|
|
1.4 Converting from binary to hexadecimal.
|
|
1.5 Converting from hexadecimal to decimal.
|
|
cs_practical_exam.docx | |
File Size: | 174 kb |
File Type: | docx |
1.6 Use of the hexadecimal system
1. Memory dumps
A memory dump is the process of taking all information content in RAM and writing it to a storage drive. Developers commonly use memory dumps to gather diagnostic information at the time of a crash to help them troubleshoot issues and learn more about the event.
2. Hyper Text Mark up Language
HTML is used when writing and developing web pages.
HTML code is often used to represent colours of text on the computer screen.
#FF 00 00 represents primary colour red.
3. Media Access Control (MAC)
MAC address refers to a number which uniquely identifiers a device on the internet. It is usually made up of 48 bits which are shown as six groups of hexadecimal digits.
NN:NN:NN:DD:DD:DD First half is the identity number of hte manufacturer of the device. Second half is the serial number of the device.
4. Web Addresses
Each character used on a keyboard has an ASCII code and web address uses ASCII code
Example : https://www.weebly.com/weebly/main.php#/
5. Assembly code and machine code
Computer memory can be referred to directly using machine code or assembly code. Using hexadecimal makes it much easierm faster and less error to write code compared to binary.
Chapter 2: Communication and internet technology
2.1 Data transmissions
- Direction of the data transmission
- Method of the data transmission
- Method of synchronisation
Simplex: one direction only
Half-duplex: both directions but not at the same time. (Phone conversation)
Full-duplex: both direction simultaneously.
2.2 Serial and parallel data transmissions
- Serial : one bit at a time over a single wire or channel, long distance, but slower rate.
- Parallel: several bits of data are sent down several wires or channels at the same time.
2.3 Asynchronous and synchronous data transmission
- Asynchronous : Data bits are grouped together and sent with control bits.
- Synchronous: A continuous stream of data is sent in discrete groups accompanied by timing signals.
1. Memory dumps
A memory dump is the process of taking all information content in RAM and writing it to a storage drive. Developers commonly use memory dumps to gather diagnostic information at the time of a crash to help them troubleshoot issues and learn more about the event.
2. Hyper Text Mark up Language
HTML is used when writing and developing web pages.
HTML code is often used to represent colours of text on the computer screen.
#FF 00 00 represents primary colour red.
3. Media Access Control (MAC)
MAC address refers to a number which uniquely identifiers a device on the internet. It is usually made up of 48 bits which are shown as six groups of hexadecimal digits.
NN:NN:NN:DD:DD:DD First half is the identity number of hte manufacturer of the device. Second half is the serial number of the device.
4. Web Addresses
Each character used on a keyboard has an ASCII code and web address uses ASCII code
Example : https://www.weebly.com/weebly/main.php#/
5. Assembly code and machine code
Computer memory can be referred to directly using machine code or assembly code. Using hexadecimal makes it much easierm faster and less error to write code compared to binary.
Chapter 2: Communication and internet technology
2.1 Data transmissions
- Direction of the data transmission
- Method of the data transmission
- Method of synchronisation
Simplex: one direction only
Half-duplex: both directions but not at the same time. (Phone conversation)
Full-duplex: both direction simultaneously.
2.2 Serial and parallel data transmissions
- Serial : one bit at a time over a single wire or channel, long distance, but slower rate.
- Parallel: several bits of data are sent down several wires or channels at the same time.
2.3 Asynchronous and synchronous data transmission
- Asynchronous : Data bits are grouped together and sent with control bits.
- Synchronous: A continuous stream of data is sent in discrete groups accompanied by timing signals.
Error Checking methods
1. Parity checking: Systems that use even parity have an even number of 1 bits; systems that use odd parity have an odd number of 1 bits. |
|
Internet Technologies
2.1 Internet Service Provider: Companies that provide the user with access to the internet.
2.2 Internet Protocol (IP) Address: Each device on the internet is given a unique address known as IP address. http://109.108.158.1
2.1 Internet Service Provider: Companies that provide the user with access to the internet.
2.2 Internet Protocol (IP) Address: Each device on the internet is given a unique address known as IP address. http://109.108.158.1
Unit 3 :: Logic Gates
Seven different logic gates will be considered in the IGCSE exam.
Complete the truth table for the following logic circuit and then consider what simplified design could replace the whole logic circuit.
Need to use boolean algebra: x = A or B (x=a+b), x= A and B (x=a.b), A +AB = A , A A=A, A+A=A
Need to use boolean algebra: x = A or B (x=a+b), x= A and B (x=a.b), A +AB = A , A A=A, A+A=A
First, input P AND input Q, So you will get P.Q = PQ, then Q OR R will give you (Q+R). Next step, OR gate between input PQ and (Q+R) will give you PQ + (Q+R). The last logic is AND gate. So R AND PQ + (Q+R). That is R(PQ + (Q+R)) which is equal to X.
X=R(PQ + (Q+R))
= PQR + QR +RR
= PQR + QR +R. (R R= R)
= PQR +R. (QR +R=R) Now you can draw a new logic circuit diagram.
X=R(PQ + (Q+R))
= PQR + QR +RR
= PQR + QR +R. (R R= R)
= PQR +R. (QR +R=R) Now you can draw a new logic circuit diagram.
Unit 4 :: Operating Systems and Computer Architecture
Operating system: Essentially software running in the background of a computer system.
When a computer is first powered up, the initiating programs are loaded into memory from the ROM (read only memory) chip. These programs run a checking procedure to make sure the hardware, processor, internal memory and bios (basic input–output system) are all functioning correctly. If no errors are detected, then the operating system is loaded into memory.
4.4. Computer architecture
In about 1945, John von Neumann developed the idea of a stored program computer, often referred to as the VON NEUMANN ARCHITECTURE concept. His idea was to hold programs and data in a memory. Data would then move between the memory unit and the processor.
In about 1945, John von Neumann developed the idea of a stored program computer, often referred to as the VON NEUMANN ARCHITECTURE concept. His idea was to hold programs and data in a memory. Data would then move between the memory unit and the processor.
Memory Unit
• MAR memory address register • MDR memory data register • ALU arithmetic and logic unit • PC program counter • CIR current instruction register. Let us now consider how the two registers (MAR and MDR) shown in the memory unit are used. Consider the READ operation. We will use the memory section shown in Table 4.2. Suppose we want to read the contents of memory location 1111 0001; the two registers are used as follows: • The address of location 1111 0001 to be read from is first written into the MAR (memory address register): |
Table 4
|
A ‘read signal’ is sent to the computer memory using the control bus.
• The contents of memory location 1111 0001 are then put into the MDR (memory data register):
Now let us consider the WRITE operation. Again we will use the memory section shown in Table 4. Suppose this time we want to show how the value 1001 0101 was written into memory location 1111 1101.
• The data to be stored is first written into the MDR (memory data register):
• The contents of memory location 1111 0001 are then put into the MDR (memory data register):
Now let us consider the WRITE operation. Again we will use the memory section shown in Table 4. Suppose this time we want to show how the value 1001 0101 was written into memory location 1111 1101.
• The data to be stored is first written into the MDR (memory data register):
Finally, a ‘write signal’ is sent to the computer memory using the control bus and this value will then be written into the correct memory location.
(Again confirm this by looking at Table 4.) 4.5 Fetch-execute cycle To carry out a set of instructions, the processor first of all FETCHES some data and instructions from memory and stores them in suitable registers. Both the address bus and the data bus are used in this process. Once this is done, each instruction needs to be decoded before finally being EXECUTED. This is all known as the FETCH–EXECUTE CYCLE and is the last part of this puzzle. Fetch In the fetch–execute cycle, the next instruction is fetched from the memory address currently stored in the Program Counter (PC) and is then stored in the Current Instruction Register (CIR). The PC is then incremented (increased by 1) so that the next instruction can be processed. This is then decoded so that each instruction can be interpreted in the next part of the cycle. Execute The processor passes the decoded instruction as a set of control signals to the appropriate components within the computer system. This allows each instruction to be carried out in its logical sequence. |
Unit 5: Input and Output devices
Application of 2D scanners at an airport: At many airports the two-dimensional photograph in the passport is also scanned and stored as a jpeg image. The passenger’s face is also photographed using a digital camera (a 2D image is taken so it can be matched to the image taken from the passport). The two digital images are compared using face recognition/detection software. Key parts of the face are compared. The face shows several of the positions used by the face recognition software. Each position is checked when the software tries to compare two facial images. Data such as: • distance between the eyes • width of the nose • shape of the cheek bones • length of the jaw line • shape of the eyebrows are all used to identify a given face. When the image from the passport and the image taken by the camera are compared, these key positions on the face determine whether or not the two images represent the same face. 5.2 Barcode readers/scanners A barcode is a series of dark and light parallel lines of varying thickness. The numbers 0 to 9 are each represented by a unique series of lines. Various barcode methods for representing these digits exist. The example we shall use adopts different codes for digits appearing on the left and for digits appearing on the right (known as UPC (Universal Product Code) version A). The actual left-hand and right-hand sides of the barcode are separated using guard bars. |
5.3: Quick response (QR) codes
Another type of barcode is the QUICK RESPONSE (QR) CODE. This is made up of a matrix of filled-in dark squares on a light background. For example, the QR code in Figure 5.8 contains the message: ‘computer science textbook – CIE syllabus’. To make a comparison, normal barcodes (as described in Section 5.2.2) can hold up to 30 digits; QR codes can hold over 7000 digits. This obviously gives greater scope for the storage of information. 5.3 Touchscreens Touchscreens are now a very common form of input device. |
Chapter 6 Memory and Data Storage
• file formats such as MIDI, MP3 and jpeg
• file compression techniques
• primary, secondary and off-line storage
• magnetic, optical and solid-state media.
6.2 File formats
A number of different file formats are used in computer systems. We will look at the following ones:
• Musical Instrument Digital Interface (MIDI)
• MP3
• MP4
• jpeg
• text and number format.
MUSICAL INSTRUMENT DIGITAL INTERFACE (MIDI) is always associated with the storage of music files. However, MIDI files are not music and don’t contain any sounds; they are very different to, for example, MP3 files. MIDI is essentially a communications protocol that allows electronic musical instruments to interact with each other. The MIDI protocol uses 8-bit serial transmission with one start bit and one stop bit, and is therefore asynchronous (see Section 2.2.3).
A MIDI file consists of a list of commands that instruct a device (for example, an electronic organ, sound card in a computer or in a mobile phone) how to produce a particular sound or musical note. Each MIDI command has a specific sequence of bytes. The first byte is the status byte – this informs the MIDI device what function to perform. Encoded in the status byte is the MIDI channel. MIDI operates on 16 different channels, which are numbered 0 to 15.
Examples of MIDI commands include:
• note on/off: this indicates that a key (on an electronic keyboard) has been pressed/released to produce/stop producing a musical note
• key pressure: this indicates how hard the key has been pressed (this could indicate loudness of the music note or whether any vibrato has been used, and so on).
Two additional bytes are required, a PITCH BYTE, which tells the MIDI device which note to play, and a VELOCITY BYTE, which tells the device how loud to play the note. When music or sound is recorded on a computer system, these MIDI messages are saved in a file which is recognised by the file extension .mid.
If this .mid file is played back through a musical instrument, such as an electronic keyboard, the music will be played back in an identical way to the original. The whole piece of music will have been stored as a series of commands but no actual musical notes. This makes it a very versatile file structure, since the same file could be fed back through a different electronic instrument, such as an electric guitar, with different effects to the original. However, to play back through an instrument such as a guitar would need the use of SEQUENCER SOFTWARE, since the MIDI files wouldn’t be recognised in their ‘raw’ form.
Both the electronic instruments and the computer need a MIDI interface to allow them to ‘talk’ to each other. It was mentioned earlier that the MIDI operates on 16 channels. In fact the computer can send data out on all 16 MIDI channels at the same time. For example, 16 MIDI devices, each set up for a different MIDI channel, could be connected to the computer. Each device could be playing a separate line in a song from the sequencer software, effectively creating an electronic orchestra. This implementation is being used more and more today in the recording studio, by major orchestras and in musical scores used in films.
Because MIDI files don’t contain any audio tracks, their size, compared with an MP3 file, is considerably smaller. For example, a 10 megabyte MP3 file only requires about 10 kilobyte file size when using the MIDI format. This makes them ideal for devices where memory is an issue; for example, storing ring tones on a mobile phone.
• file formats such as MIDI, MP3 and jpeg
• file compression techniques
• primary, secondary and off-line storage
• magnetic, optical and solid-state media.
6.2 File formats
A number of different file formats are used in computer systems. We will look at the following ones:
• Musical Instrument Digital Interface (MIDI)
• MP3
• MP4
• jpeg
• text and number format.
MUSICAL INSTRUMENT DIGITAL INTERFACE (MIDI) is always associated with the storage of music files. However, MIDI files are not music and don’t contain any sounds; they are very different to, for example, MP3 files. MIDI is essentially a communications protocol that allows electronic musical instruments to interact with each other. The MIDI protocol uses 8-bit serial transmission with one start bit and one stop bit, and is therefore asynchronous (see Section 2.2.3).
A MIDI file consists of a list of commands that instruct a device (for example, an electronic organ, sound card in a computer or in a mobile phone) how to produce a particular sound or musical note. Each MIDI command has a specific sequence of bytes. The first byte is the status byte – this informs the MIDI device what function to perform. Encoded in the status byte is the MIDI channel. MIDI operates on 16 different channels, which are numbered 0 to 15.
Examples of MIDI commands include:
• note on/off: this indicates that a key (on an electronic keyboard) has been pressed/released to produce/stop producing a musical note
• key pressure: this indicates how hard the key has been pressed (this could indicate loudness of the music note or whether any vibrato has been used, and so on).
Two additional bytes are required, a PITCH BYTE, which tells the MIDI device which note to play, and a VELOCITY BYTE, which tells the device how loud to play the note. When music or sound is recorded on a computer system, these MIDI messages are saved in a file which is recognised by the file extension .mid.
If this .mid file is played back through a musical instrument, such as an electronic keyboard, the music will be played back in an identical way to the original. The whole piece of music will have been stored as a series of commands but no actual musical notes. This makes it a very versatile file structure, since the same file could be fed back through a different electronic instrument, such as an electric guitar, with different effects to the original. However, to play back through an instrument such as a guitar would need the use of SEQUENCER SOFTWARE, since the MIDI files wouldn’t be recognised in their ‘raw’ form.
Both the electronic instruments and the computer need a MIDI interface to allow them to ‘talk’ to each other. It was mentioned earlier that the MIDI operates on 16 channels. In fact the computer can send data out on all 16 MIDI channels at the same time. For example, 16 MIDI devices, each set up for a different MIDI channel, could be connected to the computer. Each device could be playing a separate line in a song from the sequencer software, effectively creating an electronic orchestra. This implementation is being used more and more today in the recording studio, by major orchestras and in musical scores used in films.
Because MIDI files don’t contain any audio tracks, their size, compared with an MP3 file, is considerably smaller. For example, a 10 megabyte MP3 file only requires about 10 kilobyte file size when using the MIDI format. This makes them ideal for devices where memory is an issue; for example, storing ring tones on a mobile phone.
MPEG-3 (MP3) uses technology known as AUDIO COMPRESSION to convert music and other sounds into an MP3 file format. Essentially, this compression technology will reduce the size of a normal music file by about 90 per cent. For example, an 80 megabyte music CD can be reduced to 8 megabytes using MP3 technology.
MP3 files are used in MP3 players, computers or mobile phones. Files can be downloaded from the internet, or CDs can be converted to MP3 format. The CD files are converted using FILE COMPRESSION software. Whilst the music quality can never match the ‘full’ version found on a CD, the quality is satisfactory for most general purposes.
But how can the original music file be reduced by 90 per cent whilst still retaining most of the music quality? This is done using file compression algorithms which use PERCEPTUAL MUSIC SHAPING; this essentially removes sounds that the human ear can’t hear properly. For example, if two sounds are played at the same time, only the louder one can be heard by the ear, so the softer sound is eliminated. This means that certain parts of the music can be removed without affecting the quality too much.
MP3 files use what is known as a LOSSY FORMAT (see Section 6.3.2) since part of the original file is lost following the compression algorithm. This means that the original file can’t be put back together again. However, even the quality of MP3 files can be different since it depends on the BIT RATE – this is the number of bits per second used when creating the file. Bit rates are roughly between 80 and 320 kilobits per second; usually 200 or higher gives a sound quality close to a normal CD.
MPEG-4 (MP4) files are slightly different to MP3 files. This format allows the storage of multimedia files rather than just sound. Music, videos, photos and animation can all be stored in the MP4 format. Videos, for example, could be streamed over the internet using the MP4 format without losing any real discernable quality.
MP3 files are used in MP3 players, computers or mobile phones. Files can be downloaded from the internet, or CDs can be converted to MP3 format. The CD files are converted using FILE COMPRESSION software. Whilst the music quality can never match the ‘full’ version found on a CD, the quality is satisfactory for most general purposes.
But how can the original music file be reduced by 90 per cent whilst still retaining most of the music quality? This is done using file compression algorithms which use PERCEPTUAL MUSIC SHAPING; this essentially removes sounds that the human ear can’t hear properly. For example, if two sounds are played at the same time, only the louder one can be heard by the ear, so the softer sound is eliminated. This means that certain parts of the music can be removed without affecting the quality too much.
MP3 files use what is known as a LOSSY FORMAT (see Section 6.3.2) since part of the original file is lost following the compression algorithm. This means that the original file can’t be put back together again. However, even the quality of MP3 files can be different since it depends on the BIT RATE – this is the number of bits per second used when creating the file. Bit rates are roughly between 80 and 320 kilobits per second; usually 200 or higher gives a sound quality close to a normal CD.
MPEG-4 (MP4) files are slightly different to MP3 files. This format allows the storage of multimedia files rather than just sound. Music, videos, photos and animation can all be stored in the MP4 format. Videos, for example, could be streamed over the internet using the MP4 format without losing any real discernable quality.
Joint Photographic Expert Group (JEPG)
An image that is 2048 pixels wide and 1536 pixels high is equal to 2048 × 1536 pixels; in other words, 3 145 728 pixels. This is often referred to as a 3-megapixel image (although it is obviously slightly larger). A raw bitmap can often be referred to as a TIFF or BMP image (file extension .TIF or .BMP). The file size of this image is determined by the number of pixels. In the previous example, a 3-megapixel image would be 3 megapixels × 3 colours. In other words, 9 megabytes (each pixel occupies 3 bytes because it is made up of the three main colours: red, green and blue). TIFF and BMP are the highest image quality because, unlike jpeg, they are not in a compressed format.
The same image stored in jpeg format would probably occupy between 0.6 megabytes and 1.8 megabytes.
Jpeg relies on certain properties of the human eye and, up to a point, a certain amount of file compression can take place without any real loss of quality. The human eye is limited in its ability to detect very slight differences in brightness and in colour hues. For example, some computer imaging software boasts that it can produce over 40 million different colours – the human eye is only able to differentiate about 10 million colours.
An image that is 2048 pixels wide and 1536 pixels high is equal to 2048 × 1536 pixels; in other words, 3 145 728 pixels. This is often referred to as a 3-megapixel image (although it is obviously slightly larger). A raw bitmap can often be referred to as a TIFF or BMP image (file extension .TIF or .BMP). The file size of this image is determined by the number of pixels. In the previous example, a 3-megapixel image would be 3 megapixels × 3 colours. In other words, 9 megabytes (each pixel occupies 3 bytes because it is made up of the three main colours: red, green and blue). TIFF and BMP are the highest image quality because, unlike jpeg, they are not in a compressed format.
The same image stored in jpeg format would probably occupy between 0.6 megabytes and 1.8 megabytes.
Jpeg relies on certain properties of the human eye and, up to a point, a certain amount of file compression can take place without any real loss of quality. The human eye is limited in its ability to detect very slight differences in brightness and in colour hues. For example, some computer imaging software boasts that it can produce over 40 million different colours – the human eye is only able to differentiate about 10 million colours.
Activity 6.2
a. An image is 1200 pixels by 1600 pixels. Calculate:
i the total number of pixels in the original image
ii the number of bytes occupied by this file
iii the file size of the jpeg image (in kilobytes) if the original image was reduced by a factor of 8.
b. A second image is 3072 pixels by 2304 pixels. Calculate:
i the total number of pixels in the original image ii the number of bytes occupied by this file iii the file size of the jpeg image (in megabytes) if the original image was reduced by a factor of 5.
iv How many uncompressed files of the size calculated in part (ii) could be stored on a 4-gigabyte memory card?
v How many compressed files of the size calculated in part (iii) could be stored on the same 4-gigabyte memory card?
a. An image is 1200 pixels by 1600 pixels. Calculate:
i the total number of pixels in the original image
ii the number of bytes occupied by this file
iii the file size of the jpeg image (in kilobytes) if the original image was reduced by a factor of 8.
b. A second image is 3072 pixels by 2304 pixels. Calculate:
i the total number of pixels in the original image ii the number of bytes occupied by this file iii the file size of the jpeg image (in megabytes) if the original image was reduced by a factor of 5.
iv How many uncompressed files of the size calculated in part (ii) could be stored on a 4-gigabyte memory card?
v How many compressed files of the size calculated in part (iii) could be stored on the same 4-gigabyte memory card?
Text and number file formats
Text and numbers can be stored in a number of formats. Text is usually stored in an ASCII format.
When using spreadsheets or databases, for example, numbers can be stored in a number of different formats:
• real, e.g. 2.71678
• integer, e.g. 3
• date, e.g. 12/08/2016
• time, e.g. 19:45:50
• currency, e.g. R$ 15.50
Text and numbers can be stored in a number of formats. Text is usually stored in an ASCII format.
When using spreadsheets or databases, for example, numbers can be stored in a number of different formats:
• real, e.g. 2.71678
• integer, e.g. 3
• date, e.g. 12/08/2016
• time, e.g. 19:45:50
• currency, e.g. R$ 15.50
6 Lossless and lossy file compression
6.3.1 Lossless file compression
With LOSSLESS FILE COMPRESSION, all the data bits from the original file are reconstructed when the file is again uncompressed. This is particularly important for files where loss of any data would be disastrous – for example, a spreadsheet file.
6.3.2 Lossy file compression
LOSSY FILE COMPRESSION is very different to lossless file compression. With this technique, the file compression algorithm eliminates unnecessary bits of data as seen in MP3 and jpeg formats.
It is impossible to get the original file back once it is compressed. This is why it is chosen for files where removing certain bits doesn’t detract from the quality.
6.4 Memory and storage
Memory and storage devices can be split up into three distinct groups:
• primary memory
• secondary storage
• off-line storage.
Figure 6.3 shows how these all link together:
6.3.1 Lossless file compression
With LOSSLESS FILE COMPRESSION, all the data bits from the original file are reconstructed when the file is again uncompressed. This is particularly important for files where loss of any data would be disastrous – for example, a spreadsheet file.
6.3.2 Lossy file compression
LOSSY FILE COMPRESSION is very different to lossless file compression. With this technique, the file compression algorithm eliminates unnecessary bits of data as seen in MP3 and jpeg formats.
It is impossible to get the original file back once it is compressed. This is why it is chosen for files where removing certain bits doesn’t detract from the quality.
6.4 Memory and storage
Memory and storage devices can be split up into three distinct groups:
• primary memory
• secondary storage
• off-line storage.
Figure 6.3 shows how these all link together:
Random Access Memory (RAM)
The features of RANDOM ACCESS MEMORY (RAM) are: • it is volatile/temporary memory (the contents of the memory are lost when the power to the RAM is turned off) • it is used to store: • data, • files, or • part of the operating system that are currently in use • it can be written to or read from and the contents of the memory can be changed. In general, the larger the size of RAM the faster the computer will operate. In reality, the RAM never runs out of memory; it continues to operate but just gets slower and slower. As the RAM becomes full, the processor has to continually access the hard disk drive to overwrite old data on RAM with new data. By increasing the RAM size, the number of times this access operation is carried out is reduced, making the computer run faster. RAM is much faster to write to or read from than other types of memory; but its main drawback is its volatility. |
There are currently two types of RAM technology:
• dynamic ram (DRAM)
• static RAM (SRAM).
Dynamic RAM (DRAM)
Each DYNAMIC RAM (DRAM) chip consists of a number of transistors and capacitors. Each of these parts is tiny since a single RAM chip will contain millions of transistors and capacitors. The function of each part is:
• capacitor – this holds the bits of information (0 or 1)
• transistor – this acts like a switch; it allows the chip control circuitry to read the capacitor or change the capacitor’s value.
This type of RAM needs to be constantly REFRESHED (that is, the capacitor needs to be recharged every 15 microseconds otherwise it would lose its value). If it wasn’t refreshed, the capacitor’s charge would leak away very quickly, leaving every capacitor with the value 0.
DRAMs have a number of advantages over SRAMs:
• they are much less expensive to manufacture than SRAM
• they consume less power than SRAM
• they have a higher storage capacity than SRAM.
Static RAM (SRAM)
A big difference between SRAM and DRAM is that this type of memory doesn’t need to be constantly refreshed.
It makes use of ‘flip flops’ which hold each bit of memory.
SRAM is much faster than DRAM when it comes to data access (typically, access time for SRAM is 25 nanoseconds and for DRAM is 60 nanoseconds).
DRAM is the most common type of RAM used in computers, but where absolute speed is essential, then SRAM is the preferred technology. For example, the processor’s MEMORY CACHE is the high speed portion of the memory; it is effective because most programs access the same data or instructions many times. By keeping as much of this information as possible in SRAM, the computer avoids having to access the slower DRAM.
• dynamic ram (DRAM)
• static RAM (SRAM).
Dynamic RAM (DRAM)
Each DYNAMIC RAM (DRAM) chip consists of a number of transistors and capacitors. Each of these parts is tiny since a single RAM chip will contain millions of transistors and capacitors. The function of each part is:
• capacitor – this holds the bits of information (0 or 1)
• transistor – this acts like a switch; it allows the chip control circuitry to read the capacitor or change the capacitor’s value.
This type of RAM needs to be constantly REFRESHED (that is, the capacitor needs to be recharged every 15 microseconds otherwise it would lose its value). If it wasn’t refreshed, the capacitor’s charge would leak away very quickly, leaving every capacitor with the value 0.
DRAMs have a number of advantages over SRAMs:
• they are much less expensive to manufacture than SRAM
• they consume less power than SRAM
• they have a higher storage capacity than SRAM.
Static RAM (SRAM)
A big difference between SRAM and DRAM is that this type of memory doesn’t need to be constantly refreshed.
It makes use of ‘flip flops’ which hold each bit of memory.
SRAM is much faster than DRAM when it comes to data access (typically, access time for SRAM is 25 nanoseconds and for DRAM is 60 nanoseconds).
DRAM is the most common type of RAM used in computers, but where absolute speed is essential, then SRAM is the preferred technology. For example, the processor’s MEMORY CACHE is the high speed portion of the memory; it is effective because most programs access the same data or instructions many times. By keeping as much of this information as possible in SRAM, the computer avoids having to access the slower DRAM.
Read Only Memory (ROM)
The main features of READ ONLY MEMORY (ROM) can be summarised as follows:
• they are non-volatile/permanent memories (the contents of the memory remain even when the power to the ROM is turned off)
• they are often used to store the start-up instructions when the computer is first switched on (for example, ROM might store the basic input/output system (BIOS))
• the data or contents of a ROM chip can only be read; they cannot be changed.
Application
We will now consider an application, other than a computer, where both RAM and ROM chips are used.
A remote-controlled toy car has a circuitry which contains both RAM and ROM chips. The remote control is a hand-held device.
We will consider the function of each type of memory independently:
• ROM
• stores the factory settings such as remote control frequencies
• stores the ‘start-up’ routines when the toy car is first switched on
• stores the set routines; for example, how the buttons on the hand-held device control turning left, acceleration, stopping, and so on.
• RAM
• the user may wish to program in their own routines; these new instructions would be stored in the RAM chip
• the RAM chip will store the data/instructions received from the remote control unit.
Activity 6.4
Describe how ROM and RAM chips could be used in the following devices:
a a microwave oven
b a refrigerator
c a remote-controlled model aeroplane; the movement of the aeroplane is controlled by a hand-held device.
The main features of READ ONLY MEMORY (ROM) can be summarised as follows:
• they are non-volatile/permanent memories (the contents of the memory remain even when the power to the ROM is turned off)
• they are often used to store the start-up instructions when the computer is first switched on (for example, ROM might store the basic input/output system (BIOS))
• the data or contents of a ROM chip can only be read; they cannot be changed.
Application
We will now consider an application, other than a computer, where both RAM and ROM chips are used.
A remote-controlled toy car has a circuitry which contains both RAM and ROM chips. The remote control is a hand-held device.
We will consider the function of each type of memory independently:
• ROM
• stores the factory settings such as remote control frequencies
• stores the ‘start-up’ routines when the toy car is first switched on
• stores the set routines; for example, how the buttons on the hand-held device control turning left, acceleration, stopping, and so on.
• RAM
• the user may wish to program in their own routines; these new instructions would be stored in the RAM chip
• the RAM chip will store the data/instructions received from the remote control unit.
Activity 6.4
Describe how ROM and RAM chips could be used in the following devices:
a a microwave oven
b a refrigerator
c a remote-controlled model aeroplane; the movement of the aeroplane is controlled by a hand-held device.
We have completed the Cambridge IGCSE Computer Science course before end of February. Now we will be working on the past question papers.
Reminder: Computer Science Paper 12 Theory: 13 May 2020
Paper 22 Problem- Solving and Programming 15 May 2020
Reminder: Computer Science Paper 12 Theory: 13 May 2020
Paper 22 Problem- Solving and Programming 15 May 2020
0024_chan_naing_kha.pdf.pdf | |
File Size: | 53 kb |
File Type: |
0478 / AY Computer Science 2019 May/June Past papers (Questions)
0478_s19_qp_12.pdf | |
File Size: | 1931 kb |
File Type: |
0478_s19_qp_22.pdf | |
File Size: | 2411 kb |
File Type: |
0478 / AY Computer Science 2019 May/June Past papers (Mark Scheme)
0478_s19_ms_12.pdf | |
File Size: | 150 kb |
File Type: |
0478_s19_ms_22.pdf | |
File Size: | 166 kb |
File Type: |
0478 / AY Computer Science 2019 March Past papers (Questions)
0478_m19_qp_12.pdf | |
File Size: | 1942 kb |
File Type: |
0478_m19_qp_22.pdf | |
File Size: | 2392 kb |
File Type: |
0478 / AY Computer Science 2019 March Past papers (Mark Scheme)
0478_m19_ms_12.pdf | |
File Size: | 133 kb |
File Type: |
0478_m19_ms_22.pdf | |
File Size: | 144 kb |
File Type: |
0478 / AY Computer Science 2018 Oct/Nov Past papers (Questions)
0478_w18_qp_12.pdf | |
File Size: | 2030 kb |
File Type: |
0478_w18_qp_22.pdf | |
File Size: | 2374 kb |
File Type: |
0478 / AY Computer Science 2018 Oct/Nov Past papers (Mark Scheme)
0478_w18_ms_12.pdf | |
File Size: | 141 kb |
File Type: |
0478_w18_ms_22.pdf | |
File Size: | 167 kb |
File Type: |
IGCSE2 Python Programming
Python Program download. windows version 3.8.2 32 bits |
|
1. Download and install the program.
2. Write a program to convert a denary number to binary number using 8 bit registers and a while loop.
here is pseudocode.
(1) Get a denary number from user. ( int(input("Enter a number: ")
(2) Assign a digital number for 128 bits. (D = 128)
(3) Use a while loop with a condition D is greater than 0.5
(4) x has to be decreased by D.
(5) If (x <0): print (0) then x has to be increased by D. Else: print(1)
(6) D =D/2
If user type a number 23, then the results will be 0 0 0 1 0 1 1 1
3. Write a python program to enter 10 integer numbers and print out maximum and minimum numbers.
4. Predict the output of the following program modules.
for i in [1,2,3,4,5,6,7,8,9,10]:
print('*')
next
for i in range(10):
print(i)
next
counter= 0
while (counter <10):
print('*')
counter = counter +1
a=True
while a:
print('1: Addition')
print('2: Subtraction')
print('3: Multiplication')
print('4: Division')
print('5: Stop')
b=int(input("Enter your choice : "))
if (b<0) or (b>4):
a=False;
break
print('Done')
2. Write a program to convert a denary number to binary number using 8 bit registers and a while loop.
here is pseudocode.
(1) Get a denary number from user. ( int(input("Enter a number: ")
(2) Assign a digital number for 128 bits. (D = 128)
(3) Use a while loop with a condition D is greater than 0.5
(4) x has to be decreased by D.
(5) If (x <0): print (0) then x has to be increased by D. Else: print(1)
(6) D =D/2
If user type a number 23, then the results will be 0 0 0 1 0 1 1 1
3. Write a python program to enter 10 integer numbers and print out maximum and minimum numbers.
4. Predict the output of the following program modules.
for i in [1,2,3,4,5,6,7,8,9,10]:
print('*')
next
for i in range(10):
print(i)
next
counter= 0
while (counter <10):
print('*')
counter = counter +1
a=True
while a:
print('1: Addition')
print('2: Subtraction')
print('3: Multiplication')
print('4: Division')
print('5: Stop')
b=int(input("Enter your choice : "))
if (b<0) or (b>4):
a=False;
break
print('Done')
5. Read 10.1 to 10.6. on page 134 to 139.
6. Example 1 : Tickets are sold for a concert at $20 each. If 10 tickets are bought then the discount is 10%; if 20 tickets are bought is 20%. No more than 25 tickets cn be bought in a single transaction. (a) use pseudocode to write a python program to calculate the cost of buying a given number of tickets. REPEAT PRINT "HOW MANY TICKETS WOULD YOU LIKE TO BUY: " PRINT NumberOfTickets UNTIL NumberOfTickets >0 AND NumberOfTickets < 25 IF NumberOfTickets < 10 THEN Discount = 0 ELSE IF NumberOfTickets < 20 THEN Discount = 0.1 ELSE. Discount = 0.2 ENDIF ENDIF Cost = NumberOfTickets * 20 * (1-Discount) PRINT "Your tickets cost ", Cost (b) Would use test data with values of 0, 26 1, 25 Expected results 20, 400 9, 10 Expected results 180, 180 19, 20 Expected results 342, 320 |
5. Example 2
A school with 600 students wants ot produce some information from the results of the four standard tests in Maths, Science, English, and IT. Each test is out of 100 marks. The information output should be the highest, lowest and average mark for each test and the highest, lowest, and average mark overall. All the marks need ot be input.
(a) Use pseudocode to write a python program to complete this task.
A school with 600 students wants ot produce some information from the results of the four standard tests in Maths, Science, English, and IT. Each test is out of 100 marks. The information output should be the highest, lowest and average mark for each test and the highest, lowest, and average mark overall. All the marks need ot be input.
(a) Use pseudocode to write a python program to complete this task.
Chapter 10 Pseudocode and Flowcharts
In this chapter you will learn about:
• the pseudocode for assignment, using ←
• the pseudocode for conditional statements
IF … THEN … ELSE … ENDIF CASE … OF … OTHERWISE … ENDCASE
• the pseudocode for loop structures
FOR … TO … NEXT REPEAT … UNTIL WHILE … DO … ENDWHILE
• the pseudocode for input and output statements
INPUT and OUTPUT (e.g. READ and PRINT)
• the pseudocode for standard actions
totalling (e.g. Sum ← Sum + Number) counting (e.g. Count ← Count + 1)
• the standard flowchart symbols for the above statements, commands and structures.
In this chapter you will learn about:
• the pseudocode for assignment, using ←
• the pseudocode for conditional statements
IF … THEN … ELSE … ENDIF CASE … OF … OTHERWISE … ENDCASE
• the pseudocode for loop structures
FOR … TO … NEXT REPEAT … UNTIL WHILE … DO … ENDWHILE
• the pseudocode for input and output statements
INPUT and OUTPUT (e.g. READ and PRINT)
• the pseudocode for standard actions
totalling (e.g. Sum ← Sum + Number) counting (e.g. Count ← Count + 1)
• the standard flowchart symbols for the above statements, commands and structures.
Python Programming Examples
1. Simple Calculator
- Define function with return value.
- Integer input
- Nested IF statements
1. Simple Calculator
- Define function with return value.
- Integer input
- Nested IF statements
2. CASE example
Chapter 10. No(4) A sweet shop sells 500 different sorts of sweets. Each sort of sweet is identified by a unique four digital code. All sweets tht start with a one (1) are chocolates, all sweets that start with a two (2) are toffees, all sweet that start with a three (3) are jellies and all other sweets are miscellaneous and can start with any other digits except zero.
6 Daniel lives in Italy and travels to Mexico, India and New Zealand. The time differences are:
Country Hours Minutes
Mexico –7 0
India +4 +30
New Zealand +11 0
Thus, if it is 10:15 in Italy it will be 14:45 in India.
(a) Write an algorithm, using pseudocode or otherwise, which:
• inputs the name of the country
• inputs the time in Italy in hours (H) and minutes (M)
• calculates the time in the country input using the data from the table
• outputs the country and the time in hours and minutes.
(b) Describe, with examples, two sets of test data you would use to test your algorithm.
Country Hours Minutes
Mexico –7 0
India +4 +30
New Zealand +11 0
Thus, if it is 10:15 in Italy it will be 14:45 in India.
(a) Write an algorithm, using pseudocode or otherwise, which:
• inputs the name of the country
• inputs the time in Italy in hours (H) and minutes (M)
• calculates the time in the country input using the data from the table
• outputs the country and the time in hours and minutes.
(b) Describe, with examples, two sets of test data you would use to test your algorithm.
Pseudocode:
cambridge_igcse_computer_science.pdf | |
File Size: | 23279 kb |
File Type: |
0478_w19_qp_12.pdf | |
File Size: | 913 kb |
File Type: |