Computer science (0984): Theory

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/183

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

184 Terms

1
New cards

Computer

A device that receives input, processes that input, and then produces the output.

2
New cards

Definitions

3
New cards

Denary

  • It has a base of 10

  • It uses ten values that are 0 to 9

  • Units increase by power of 10

4
New cards

Binary

  • It has a base of 2

  • It only uses two values that are 0 and 1

  • Units increase by power of 2

5
New cards

Why is data stored as binary in computers?

  • As computers consist of logic gates

  • Logic gates can only process data in two states (0 and 1)

6
New cards

Hexadecimal

  • It has a base of 16

  • It uses sixteen values that are 0 to 9 and A to F

  • Units increase by power of 16

7
New cards

Conversion of Denary to Binary

8
New cards

Conversion of Binary to Denary

9
New cards

Conversion of Hexadecimal to Binary

10
New cards

Conversion of Binary to Hexadecimal

11
New cards

Conversion of Hexadecimal to Denary

12
New cards

Conversion of Denary to Hexadecimal

13
New cards

Why is hexadecimal preferred by programmers rather than binary?

  • Easier for programmers to read and understand

  • Easier to debug

  • Takes up less space on the screen

  • Fewer errors made in data transcription

14
New cards

Uses of hexadecimal

  • MAC addresses

  • IPv6 addresses

  • ASCII // Unicode

  • Debugging

  • HTML colour codes

15
New cards

Bit

One binary digit.

16
New cards

Nibble

A group of 4 bits.

17
New cards

Byte

A group of 8 bits.

18
New cards

More memory units:

KMGTBE —→ The diff between each is 1024

19
New cards

Text is represented using a character sets:

  • ASCII

  • Unicode

20
New cards

Character set

  • A list of all characters and symbols that can be represented by a computer system

  • Each character/symbol is assigned a unique value.

21
New cards

ASCII

  • A character set for all the characters on a standard English keyboard

  • Each character is represented using 8 bits

22
New cards

Unicode

  • A character set which can represent all the languages of the world

  • Each character is represented using up to 32 bits

23
New cards

Differences between ASCII set and Unicode

  • Unicode has more characters than ASCII

  • Unicode includes more languages than ASCII

  • Unicode includes emojis while ASCII don’t

  • Text stored in Unicode takes up more storage space

24
New cards

Why does text stored using Unicode require more storage space than ASCII:

Unicode requires more bits per character than ASCII.

25
New cards

How text is converted to binary:

  • A character set is used

  • … such as Unicode/ASCII

  • Each character has a unique binary value

26
New cards

Images

An image is a series of pixels.

Important note:

  • The file size and quality of the image depend on the image resolution and the colour depth

27
New cards

Definitions

28
New cards

How an image is converted to binary:

  • Each pixel represents a colour and is given a binary value to be processed by the computer

  • Pixels are stored in sequence in the file

  • The image resolution is set that is the dimensions of the image

  • The colour depth is set that is the number of bits used to represent each colour

29
New cards

Effect of increasing the image resolution

  • The image will have more detail

  • The image will be closer to real-life

  • The file will require more storage space

30
New cards

Effect of increasing the colour depth

More bits are allocated to each pixel, so..

  • .. the image will have more detail

  • .. the image will be closer to real-life

  • .. the file will require more storage space

31
New cards

Size of an image file

32
New cards

How audio is converted to binary:

  • The sound wave is sampled measuring the amplitude

  • Each amplitude has a unique binary value

  • The sampling rate is set that is the number of samples taken per second

  • The sampling resolution* is set that is the number of bits used to represent each sample

  • Each sample taken is converted to binary

33
New cards

Definitions

34
New cards

Effect of increasing the sampling resolution

More bits are allocated to each amplitude so..

  • .. amplitudes are closer to the original sound

  • .. a wider range of amplitudes can be recorded

  • .. the file will require more storage space

35
New cards

Effect of increasing the sampling rate

More amplitudes are taken per second, so..

  • ..closer to the original sound

  • ..the file will require more storage space

36
New cards

Size of an audio file

37
New cards

Register

A small fast memory location within the CPU.

38
New cards

Definitions

39
New cards

Binary Addition

40
New cards

Negative Numbers

41
New cards

Logical Shift

A binary operation that moves bits to some places to the left or right.

  • Left logical shift: Multiply by 2

  • Right logical shift: Divide by 2

  • Issues with logical shift:

42
New cards

Analogue & digital data:

Why are converters used?

  • As humans, we use analogue data while computer only understand digital data.

  • Thus converters are used to convert from analogue to digital or vice versa

43
New cards

Converters

44
New cards

Input device, part 1:

Device used to enter data into a computer

  • Keyboard:

    1. An input device used to type in data

  • Optical mouse:

    1. An input device used to control a pointer/cursor on a screen

    2. Uses laser and optical sensor to detect movement

  • Microphone:

    1. An input device used to input sound to a computer

    • Uses:

      1. Used to input sound in voice recognition software to enhance security

      2. Used to input sound in speech recognition software to convert voice into text

  • Digital camera:

    1. Input device used to capture digital photographs

    2. It uses a lens and a sensor to capture light

  • Scanners:

    • 2D scanner:

      1. An input device used to convert hardcopy images/document into a digital format

      2. Software that works with 2D scanners: OCR & OMR

    • 3D scanner:

      1. An input device to scan solid objects & produce a 3D digital model

45
New cards

Part 2:

  • Barcode scanner:

    • Barcode: a series of black & white lines of varying thickness and is used to represent numeric digits or characters

    • Barcode scanner: An input device used to scan barcodes

    • Compared to entering data manually:

  • QR scanner:

    • QR code: Matrix of black & white squares that can link into things.

    • QR code scanner: An input method used to scan QR codes. It uses red laser & sensors to convert QR code into binary values

    • Compared to traditional barcodes:

    • Diff between QR codes & barcodes:

46
New cards

Part 3:

Touchscreen: An input device that allows simple touches to carry out many functions of a pointing device

Compared to Keyboards & mouses:

  • Capacitive touchscreen:

    • Touchscreen that operates by using the conductive properties of the object/finger that is used to touch the screen

    • Adv & Disadv:

  • Resistive touchscreen:

    • Touchscreen that makes use of two layers, when top layer is touched, top & bottom layers complete a circuit at the point of touching

    • Adv & Disadv:

  • Infrared touchscreen:

    • Touchscreen that uses sensors & infrared beams, sensors detect the point of touching through a break in a beam

    • Adv & Disadv:

47
New cards

Output devices, part 1:

A piece of hardware that produces the processed data to the user

  • Screens:

    • LED screen: A screen that is made of tiny LEDs, LED brightness can vary by varying the current sent to each LED

    • LCD screen: A screen that is made up of tiny liquid crystals & backlighting. Backlighting can be either LED technology or CCFL technology

      1. Adv of using LED backlighting over CCFL backlighting:

48
New cards

Part 2:

  • Projectors:

    • LCD projector: A projector that uses LCD screens & a special prism to project an image

      1. Adv of LCD projector over DLPs:

    • DLP: A projector that’s composed of millions of micro mirrors on a small DMD chip

      1. Adv of DLP projectors over LCD projectors:

49
New cards

Part 3:

  • Printers:

    • Inkjet printer: A printer that uses liquid ink & a moving printing head to print out data

      1. Use: Printing photographs

      2. Adv & Disadv:

    • Laser printer: A laser printer that uses toner & static electricity to print out information

      1. Use: Producing a large number of high quality flyers & posters for advertising

      2. Adv & Disadv:

    • 3D printer: Output device used to produce 3D solid objects, the solid objects are built layer by layer using a specific material

      1. Use:

        Produces:

        ..Prototypes

        ..Customized items like prosthetic limbs to exactly fill the recipient

        ..Customized items for surgical equipment

        ..Making parts for items no longer in production

      2. Adv & Disadv of using 3D printer over traditional manufacturing:

50
New cards

Part 4:

  • Speakers & headphones: Output devices that produces sound

  • Actuators: A mechanical output device that produces movement, they can rotate, close, push and pull an object

    • Use:

      1- controlling robot arm.

      2- spinning a fan.

      3- pumping water

    • Adv & Disadv:

51
New cards
52
New cards

Primary memory

Main memory inside the computer that is directly accessible by the CPU

53
New cards

Secondary storage

Non-volatile storage that is not directly accessible by the CPU

  • Purpose of secondary storage:

    • For permanent storage of data

    • To store data that isn’t currently required by the CPU

    • To allow software to be installed on the computer

    • To store data to transfer it to another computer

    • For the creation of virtual memory

  • Technologies of secondary storage:

    • Magnetic

    • Optical

    • Solid-state

54
New cards

Diff between Primary Memory and Secondary Storage:

55
New cards

Solid state devices

Eg:

  1. SSD

  2. Portable SSD

  3. SD card

  4. Usb flash memory

  • Feature/Characteristics:

    • Uses NAND/NOR to store data

    • They are made of transistors that are laid out on a grid

    • Transistors are used to control gates & floating gates to control the flow of electrons

  • How data is stored/written on it:

    1. NAND/NOR chips are made of transistors

    2. Data is stored by flashing it onto the chips

    3. The flow of electrons is controlled using transistors

    4. Data is stored sequentially as 0s & 1s inside the transistors

  • How data is read from it:

    1. Data is read sequentially by retrieving the binary values of transistors

56
New cards

Optical storage

Eg:

  1. CD

  2. DVD

  3. Blu-ray disc

  • Feature/Characteristics:

    • Data is represented as pits & land

    • Optical device lasers on the disk

    • An arm is used to move the optical devices across the disk

  • How data is stored/written on it:

    1. Disk is spun

    2. Laser beam is shone onto the surface of disk

    3. An arm moves the laser across the surface of disk

    4. The laser burns pits onto the surface of the disk

    5. Both pits & land represent binary values of 1 & 0

  • How data is read from it:

    1. laser is used to read the pits & lands

    2. Reflected light from the laser shining on disk is captured by a sensor

57
New cards

Magnetic storage device

Eg:

  1. HDD

  2. Portable HDD

  3. Magnetic tape drive

  • Feature/Characteristics:

    • Data is stored in the form of magnetic dots

    • It consists of several platters, where magnetic dots are stored

    • Data is read, written or erased as the magnetic dots under read/write heads

  • How data is stored/written on it:

    1. Data, in the form of magnetic dots, is stored on the surface of multiple platters

    2. Platters are spun at high speed

    3. Read/write heads move quickly back & forth to access all tracks & platters

    4. Read/write heads apply magnetic field to control magnetic dots

  • How data is read from it:

    1. Data is read as dots pass under read/write head

58
New cards

Adv & Disadv of using Solid state storage over Magnetic technology

59
New cards

Comparison between diff types of secondary storage

60
New cards

Cloud storage

Online storage platform. Data is stored in a remote physical location, using hundreds of interlinked data servers.

Adv & Disadv of using cloud storage over storing data locally:

61
New cards

File compression:

Effect of compression: It reduces the file size

Reasons to compress a file:

  1. To save storage space

  2. To reduce bandwidth needed to transmit

  3. To make it quicker to transmit

62
New cards

Lossless compression:

Method of compression that loses no data in the process, used when it is essential that no data is lost during compression process.

  1. Code

  2. Text file

  3. Database file

  • RLE: The repeated pattern of characters/pixels/samples are identified, then encoded into two values:

    1. Number of identical characters in the run (run count)

    2. Value of the pattern (run value)

  • Data dictionary: The repeated characters/pixels/samples are identified, then put into index & replaced by their index. The number of occurrences is stored in the table. The position of characters/pixels/samples in the file is stored in the table.

63
New cards

Lossy compression, part 1:

Method of compression where redundant details are permanently removed from the file without significantly affecting the quality of the file.

Used when there is no requirement for the files to be the same as the original file

  1. Images

  2. Audio files

  3. Video files

Adv of using Lossy compression instead of lossless compression:

64
New cards

Part 2:

How to compress an image using lossy compression:

  1. A compression algorithm is used, where redundant details are permanently removed

  2. Colour depth could be reduced

  3. Image resolution could be reduced

How to compress a sound file using lossy compression:

  1. A compression algorithm is used, where redundant details are permanently removed

  2. Sampling rate could be reduced

  3. Sampling resolution could be reduced

  4. Unnecessary sound could be discarded

65
New cards

Sensors

An input device used to measure the physical properties of the surrounding envronment

66
New cards

Automated system

A combination of software & hardware designed & programmed to work automatically without the need for human intervention

  • It consists of:

    1. Sensors to take reading

    2. Microprocessor to process data

    3. Actuator to do mechanical output

  • Adv & Disadv:

67
New cards

Automated steps:

1- (…) sensor is used

2- The sensor sends digitised data to the microprocessor

3- the microprocessor compare the value taken from the sensor with the stored value

4- if the value taken is (…) then the microprocessor sends signals to the actuator to (…)

5- if not, it operates normally

6- the process is a loop

68
New cards

Eg of automated systems:

  1. Temperature sensor is used.

  2. The sensor sends digitised data to the microprocessor .

  3. The microprocessor then compares the value taken from the sensor with the stored value.

  4. If value is less than 21 c or higher than 24 c, then the microprocessor sends a signal to the actuator to change the temperature to be between 21 c to 24 c.

  5. If it is between 21 c to 24 c, then it operates normally.

  6. The process is a continuous loop.

  1. Light sensor is used.

  2. The sensor sends digitised data to the microprocessor.

  3. The microprocessor then compares the value taken from the sensor with the stored value.

  4. If value is different than the stored value, then the microprocessor sends a signal to the actuator to turn on/off the street light for a period amount of time like 10 minutes..

  5. If the value is the same, then it operates normally.

  6. The process is a continuous loop

69
New cards

Primary memory

Main memory inside the computer that is directly accessible by the CPU

70
New cards

RAM

Volatile memory, that’s directly accessible by the CPU. Can be read from & written to.

Purpose:

  1. Used to store data/files currently in use

  2. Used to store software/programs/instructions/parts of OS currently in use

  3. Used to store data temporarily

  4. To speed up the fetch stage of FDE cycle

71
New cards

Virtual memory

A memory management system that makes use of secondary storage & software to extend RAM capacity

How virtual memory is created:

  1. Secondary storage is partitioned to create virtual memory

  2. When RAM is full, pages of data that are not required are transferred from RAM to virtual memory

  3. When data is required again, pages are transferred back to RAM

Purpose of using virtual memory:

  1. To extend RAM capacity when required

  2. Reduces the need to buy & install more expensive physical RAM

  3. Stops program from crashing when RAM is full

  4. To allow computer to process large amount of data

72
New cards

ROM

Non-volatile, directly accessible by the CPU. Can only be read from but not written to

Purpose:

  1. To store start-up instructions

  2. To store firmware

  3. To store BIOS

  4. To store bootstrap/bootloader

  5. To store data permanently

73
New cards

Diff between RAM & ROM

74
New cards

Application where RAM & ROM are both used

75
New cards

Von Neumann architecture (stored program concept)

  1. Programs are stored on a secondary storage device

  2. Data & instruction are moved to RAM & stored in it

  3. Instructions are fetched, decode and executed one after another by the CPU

76
New cards

Related components to Von neumann architecture:

Secondary storage purpose:

RAM: Ram is made up of partitions, each partition consists of an address & its contents

Purpose:

CPU: A type of integrated circuit contained on a single ship that is used to process the instructions

Structure: It consists of an ALU, CU and registers

purpose: to perform an FDE cycle // to process an instruction

77
New cards

CU

Purpose:

  1. sends control signals that manage the transfer of data & instructions within the CPU

  2. Responsible for decoding instructions using an instruction set

78
New cards

ALU

Purpose:

  1. Carries out arithmetic calculations

  2. Carries out logic operations

  3. Stores interim results of calculations in a register called accumulator

79
New cards

Registers

A small fast memory location within the CPU

Purpose: To store data/address/instruction temporarily

Eg:

  1. PC: Temporarily stores the address of the next instruction to be fetched/executed

  2. CIR: Temporarily stores the current instruction during processing

  3. MAR: Temporarily stores the address of the next instruction/data to be fetched from RAM

  4. MDR: Temporarily stores the instruction/data that is in use from the address in MAR

  5. ACC: Temporarily stores interim results during calculations

80
New cards

Buses

Pathways to transmit data, addresses and control signals between the internal components of the CPU & between CPU and RAM

81
New cards

Input/Output devices

Purpose: Main method of entering data into & getting the data out of computer systems

82
New cards

FDE cycle

Fetch:

  1. PC contains the address of the memory location of the instruction to be fetched

  2. This address is copied from PC to MAR using the address bus

  3. The contents (instruction) of the memory location contained in MAR is copied to MDR

  4. The instruction in MDR is then copied to CIR using data bus

  5. The value of the PC is incremented by one to point to the next instruction that has to be fetched

Decode:

  1. (Step 4)

  2. CU decodes the instruction using an instruction set

Execute:

  1. The CPU then executes the instruction

83
New cards

Steps of how MDR & ALU are used in FDE cycle:

84
New cards

Interrupt

A signal sent from a device or software that informs the CPU that its attention is required. Interrupts have diff priorities

Purpose:

  1. Informs the CPU that its attention is required

  2. Allows the CPU to pause the current process until the interrupt is serviced

  3. Allows the CPU to deal with vital tasks immediately based on their priority

  4. It enables multi-tasking to be carried out on a computer

Hardware Eg:

  1. A key on a keyboard is pressed

  2. A mouse button is moved

  3. A paper has jammed in a printer

  4. A printer runs out pf paper

  5. A printer runs out of ink

Software Eg:

  1. Opening an app

  2. Switching from one app to another

  3. Runtime errors

85
New cards

Steps of handling an interrupt:

  1. Interrupt is given a priority by OS & placed in the interrupt queue

  2. CPU finishes the current FDE cycle for the process & checks the priority of the interrupts in the interrupt queue

  3. If all interrupts in the queue have lower priority than the process, then the CPU runs the next FDE cycle for the process

  4. If an interrupt in the queue has higher priority than the process, the CPU pauses the process

  5. Processor checks the source of the interrupt & calls ISR to handle the interrupt

  6. If there’s no another higher priority interrupt than the process, then repeat, otherwise , CPU resumes the process by running its next FDE cycle

86
New cards

ISR

A piece of software that contains the code that handles the interrupts. It’s a part of the OS

87
New cards

Factors that determine CPU performance:

Core: A unit on a CPU that’s made up of an ALU, Cu & registers

Purpose: To perform an FDE cycle // To process an instruction

Effect of increasing No. of cores on CPU performance:

  1. Allows the CPU to process multiple instructions at the same time, increasing the CPU performance

System clock: A component that regulates the number of FDE cycles the CPU can perform in a seconds

clock speed: The max number of FDE cycles a CPU can process/execute in a second

2.4 Ghz: CPU completes 2.4 billion cycles per second

Effect of increasing the clock speed on CPU performance:

  1. increases the max number of FDE cycles the CPU can process/execute in a second, increasing CPU performance

CPU cache: It is a type of storage that stores frequently used data/instruction to speed up access as it is faster to access than RAM

Effect on CPU performance:

  1. Allows more frequently used data/instruction to be stored

  2. ..which allows the CPU to speed up access to more frequently used data/instructions

  3. ..increasing the CPU performance

88
New cards

Embedded systems

  1. Dedicated hardware

  2. Dedicated function

  3. Has a microprocessor

  4. Uses firmware

  5. Doesn’t require much power

  6. Cheap to manufacture

  7. Works automatically

  8. Small in size

  9. Real-time system

Eg:

  1. Domestic appliances

  2. Cars

  3. Security systems

  4. Lighting systems

  5. Vending systems

89
New cards

Examples of software

Software programs can be System software or Application software.

.

Application software: programs that provide the services that the user requires to perform specific tasks

General features:

  1. Run on OS

  2. Provides services that the user requires

  3. Allows user to perform specific tasks

System software: Programs that provide the services that the computer requires to manage/maintain the hardware

General features:

  1. Run on firmware

  2. All OS functions

  3. Provides services that the computer requires

90
New cards

OS

A piece of system software that performs many basic tasks & allows the user to communicate with the computer hardware

Functions:

  1. Memory management

  2. Managing peripherals

  3. Manage multi-tasking

  4. Manage files

  5. Manages user accounts

  6. Provides an interface

  7. Provides system security

  8. Provide a platform for running apps

  9. Handling interrupts

91
New cards

OS function explanation

Managing memory:

  1. Managing the movement of data to and from RAM

  2. Allows multitasking

  3. Manage the transfer of pages between virtual memory and RAM

Managing peripherals:

  1. Transmits data to hardware

  2. Receives data from hardware

  3. Allocates data to buffers

Manage multi-tasking

  1. Gives the process a priority

  2. Allocates resources for each process for a specific time limit

  3. Interrupts the running process when it exceeds its time limit

Manage files

  1. Create/Copy/Open/Close/Rename/Save a file

Manages user accounts

  1. Allowing multiple user accounts to be created on a computer

  2. Allows the user to customize their screen layout

  3. Uses separate folders and files to allow users to manage them

Provides an interface

  1. Allows the user to interact with the computer

  2. Eg: GUI & CLI

Provides system security

  1. Help prevent hacking

  2. Communicates with firewall

  3. Ensures anti-virus is always up-to-date

  4. Carries out OS updates when they become available

Provide a platform for running apps

  1. Allowing communication between the applications software and the hardware.

Handling interrupts

  1. Gives the interrupt a priority

  2. Includes the ISR, which is a piece of software that contains the code that handles the interrupts

92
New cards

Utility software

A program that performs a specific task required for the operation of the computer system

Eg:

  1. Antivirus

  2. Disk repair

  3. ackup software

  4. Screensaver

93
New cards

Firmware

A piece of software that runs directly on the hardware

Purpose:

  1. Controls/Allows communication with the hardware

  2. Stores instructions to boot up/start up the computer

  3. Provides the OS with a platform to run on

Eg of firmware:

  1. Bootloader/Bootstrap: Software that is responsible for loading the OS into the RAM

  2. BIOS: Carries out a hardware check to find out if all the devices are present & whether they are functional

How hardware, firmware and an OS are required to run applications software:

  1. App software runs on the OS

  2. The OS runs on the firmware

  3. The firmware runs on the hardware

94
New cards

Types of programming languages:

  1. High level language

A type of programming language that is close to human language

Machine independent

One line of high level language code can perform several low level language operations

It has built-in functions which save time when writing a program

95
New cards
  1. Low level language

A type of programming language that is close to native language of the computer

Machine dependent

Allows direct manipulation of memory

Allows for use of specialized hardware

Eg: Machine code & Assembly language

Machine code: The binary instructions that a computer understands & executes directly

Assembly language: A form of low level language that uses mnemonics. An assembler is needed to translate an assembly language program into machine code

96
New cards

Adv of using High level language over Low level language

  1. Closer to human language, so fater to write codes & the programmer is less likely to make mistakes while writing the code

  2. Easier to debug, so programmers can find & correct errors in less time

  3. Machine independent // Portable, so program can be used on any computer without need for understanding the hardware

  4. One line of code can carry out multiple commands, so the code is more compact

  5. It has built-in functions, so faster to wrte cod

97
New cards

Adv of using Low level language over High level language

  1. Allows direct manipulation of memory

  2. Code executes faster

  3. Code requires less memory

  4. Allows for use of specialized hardware

98
New cards

Instruction Set

A list of all machine code commands that can be processed by a CPU

Purpose:

  1. Used to define the commands that can be carried out by the CPU

  2. Used by the CU to decode instructions during processing

99
New cards

Language translators, part 1:

Software used to convert programming language code to machine code to be executed by the computer

Compiler: A program that translates a high level language code to machine code

Interpreter: A program that translates a high-level language to machine code

Assembler: A program that translates a low-levl language code to machine code

100
New cards

Part 2:

How the compiler translates the computer program:

  1. It translates the high level language to low'-level language/machine code

  2. It translates all the code before it is executed

  3. It creates an executable file

How the Compiler reports errors:

  1. It creates an error report after trying to compile

  2. ..Displaying all errors in the code

  3. ..That require correction before execution can take place