Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

1(a)

The main reason for using a memory hierarchy is to balance access


time and cost. To get the fastest speed of memory with the largest
capacity and least cost, the fast cache memory is located close to
the processor. The slower secondary memory is used to store
information permanently, and is placed farthest from the processor.
With respect to CPU, the memory is organized as follows—
1. Registers are placed inside the CPU (small capacity, high cost,
very high speed)
2. Cache memory is placed next in the hierarchy (inside and
outside the CPU)
3. Primary memory is placed next in the hierarchy
4. Secondary memory is the farthest from CPU (large capacity,
low cost, low speed)

1(b)
1(c)
Virus: Virus is a software or computer program that connects itself
to another software or computer program to harm a computer
system and spread to other computers. A virus is attached to an
executable file and cannot spread itself unless a user executes the
malicious file.

Worm: Worms are a subclass of self replicating viruses that can


spread without external help, using the internet or other information
transport systems. They are much more infectious than a standard
virus because rather than a computer sending out a single worm, it
could send out hundreds or thousands of copies of itself, creating a
potentially devastating effect.

Trojan Horse: These are malicious programs that look like a genuine
applicationTrojan horses do not replicate themselves. Trojans open a
backdoor entry to a computer which gives malicious
users/programs access to the system, allowing confidential and
personal information to be stolen.

Protection against these threats can be achieved through the


following steps:
1. Using and maintaining antivirus software
2. Learning basic malicious process types and names
3. Being careful about email attachments from unknown sources
4. Avoiding third party and pirated software sources
5. Disabling autorun on the computer
6. Having a firewall
7. Checking SSL before visiting a website
8. Using open source Operating systems like Linux or BSD
1(d)
2(a)
Firmware is specialized software that provides basic machine
instructions that allow the hardware to function and communicate
with other software running on a device. Firmware provides low-level
control for a device's hardware.

Firmware is related to regular software by the fact that firmware


allows software to properly access and utilize the hardware of a
computer system. Firmwares can be continuously updated to allow
interfacing between different and newer software to hardware. The
difference between the two exists in their proximity to hardware and
the languages used to code them. Firmware works at a much lower
level than software and hence is usually written in low-level high
performance languages such as C, C++ or Rust. Firmware is stored in
ROM while software is stored in Secondary memory.
3 devices that use firmware are:
1. Routers: to control and connect the different parts of a
router.
2. Storage devices: USB drives, hard drives and other
portable storage devices contain basic firmware that
enable them to function with a computer.
3. Smart cards Smart cards have instructions embedded in
a chip that provides the card's basic functionality, as well
as authentication and encryption
2(b)
When a key is pressed, the keyboard interacts with a keyboard
controller and keyboard buffer. The keyboard controller stores the
code of pressed key in the keyboard buffer and informs the
computer software that an action has happened on the keyboard.
The computer software checks and reads the keyboard buffer and
passes the code of pressed character to the system software. Due to
a time gap between pressing of a key on the keyboard and reading
by the system software, the keyboard buffer is designed to store
many keystrokes together.

Functional layouts can be redefined or customized within the


operating system, by reconfiguring the operating system keyboard
driver, or with the use of a separate software application. Now
keyboard firmwares like QMK/VIA allow for creating and storing
custom layouts on the keyboard itself.

Usually a keyboard is just an input device. You can only send


information to the computer by pressing the keys, but the computer
does not talk you back through it. However, if you have an RGB
keyboard, you can use those LEDs to convey some useful
information and thus use the keyboard as an output device.

2(c)
On a single-processor system, multiple processes don’t actually
run at the same time since there’s only one processor. Instead,
the processor switches among the active processes. Because
computers are so fast compared with people, it appears to the
user as though the computer is executing all of the tasks at once.
To make a single core able to run multiple processes,
time-division multiplexing is used. Here the OS sets up a timer
which interrupts the system at a fixed interval. A single interval is
known as a time slice. Everytime this interrupt occurs, the OS
runs the scheduling routine, which picks the next thread that is
due to be executed. Reassigning a CPU from one task to another
one is called a context switch. Basically, the state of CPU’s
registers and program counter at any time represent a context.
Whenever a process is entering the suspend mode, its context is
saved in memory/stack. The processor then recovers (or creates)
the context for the new process. When the first process is going
to execute again, its context is recovered. This context switch is
done by either software (operational system) or hardware.
2(d)
1. The data required to be printed is transferred from the
computer to the laser printer. This is usually via an ethernet
cable or wirelessly if the printer has wireless capabilities.
2. The printer then has to reach the required temperature via
the heating of the corona wire. This wire, once heated,
passes an electrical static charge to the drum unit.
3. The drum unit, now negatively charged, receives data from
a laser.
4. Once the laser is activated, the beam reflects off a moving
mirror unit which directs the beam directly onto the drum
unit.
5. In the areas where the beam hits the drum, the charge is
changed from negative to positive. The positively charged
areas now represent where toner particles will adhere to
the drum and be directly transferred onto the paper.
6. The ink roller now begins to coat the drum with toner. Toner
is composed of microscopic ink particles which, now
negatively charged, adhere to the positively charged areas
on the drum unit.
7. A positively charged sheet of paper is now passed close to
the drum, attracting the negatively charged toner particles
onto the page.
8. The paper, now containing the inked content, is passed into
the fuser unit where the rollers melt and fuse the toner
particles to the paper.
The page is then passed through to the other side of the printer,
and you now have one successful printout!
2(e)
Parallel and distributed computing are both computing
paradigms where multiple computer systems work on a single
problem. In distributed computing each node has separate local
memory and processors. The nodes communicate with each
other over a network, usually the internet. Each node works on a
small part of the whole problem. But in parallel computing, a
system has multiple processors that are connected together
using a shared memory pool. The system breaks the larger
problem down into small parts, then breaks those parts into
individual instructions that are executed on different
processors.

Peer to Peer Computing can be classified as a form of


Distributed Computing and Cloud Computing is a form of
parallel computing.

In P2P computing, each node is a whole computer, complete


with separate memory, storage and a processor. This is similar
to the Distributed Computing paradigm. In Cloud Computing,
each server has a large memory pool that is shared between
two or more processors with 8 or more cores each. The server
takes instructions from the end users and sends them to
whichever core is available. This system is similar to the one
from parallel computing.
3(a)
A number system is defined as the representation of numbers by
using digits or other symbols in a consistent manner

Computers use binary because


1. Modern electronics use discrete values to operate. A
binary system has only two states, ON and OFF. This gives
the system an error tolerance of nearly 50%. A decimal
based system would need to have 10 discreet states, which
would need the system to have an error tolerance of 10%
or less. The large error tolerance makes it much easier to
make binary circuits and vastly improves reliability.
2. Binary signals are unambiguous which gives it noise
immunity.
3. Only having two states makes binary computers simpler to
make.
4. Anything that can be represented with some sort of
pattern can be represented with patterns of binary bits.

These are why computers use the binary number system.


3(b)

3(c)

3(d)
Binary Subtraction using 2's Complement - YouTube
4(a)
A hard disk consists of one or more circular plates coated with a thin
magnetic layer. These plate (s) are attached concentrically on a
rotating hub or shaft and always rotate with a constant speed
around its own axis. The circular plates are divided into tracks,
which are distributed as equidistant concentric circles. Each track
contains a constant number of sectors, which divides each track into
equal sections. A sector contains at least 512 bytes. This size is the
smallest unit of disk access; as a result, at least an entire sector
must be read or written. But modern hard drives use 4KB physical
sectors.
a SSD consists of semiconductor memory building blocks, it contains
no mechanical parts. The smallest unit of an SSD is a page, which is
composed of several memory cells. Several pages on the SSD are
summarized to a block. A block is the smallest unit of access on a
SSD. Currently, the physical block size for modern flash memory is
4096 bytes.

A file system defines how files are named, stored, and retrieved
from a storage device. This can be compared to a library's
cataloging system. The catalog contains the names of all books
stored in the library and employs various techniques to sort these
books into categories. It records the entry and borrowing of
different books over time. In the same way a logical file system
stores references to every file stored on the physical storage, divides
storage into partitions for easier management, logs and facilitates
the creation and deletion of files.

4(b)
Step - 1: Start
Step - 2: Initialise an array ‘digits’
Step - 3: Let, place = 0 , D = the decimal number to be converted
and B = Base of the target number system.
Step - 4: Let Digit[place] = D mod B.
Step - 5: Let D = D div B
Step - 5: Let place = place + 1
Step - 6: if D > 0, Go to Step 3
If D == 0, Continue.
Step - 7: Reverse the array ‘digits’
Step - 8: Print the array ‘digits’

4(c)
The following are some reasons why developers use IDEs:

Code editing and automation:


IDEs allow programmers to write code and provide tools to speed up
the programming process.
Syntax highlighting:
An IDE can format the written text by automatically making some
words bold or italic, or by using different font colors. These visual
cues make the source code more readable and highlight syntax
errors.
Intelligent code completion:
IDE can make suggestions to complete a code statement when the
developer begins typing.
Refactoring support
Code refactoring is the process of restructuring the source code to
make it more efficient and readable without changing its core
functionality. IDEs can auto-refactor to some extent, allowing
developers to improve their code quickly and easily.
Compilation
IDEs simplify the process of using the compiler to convert human
readable code to machine code.
Testing
The IDE allows developers to automate unit tests locally before the
software is integrated with other developers' code and more
complex integration tests are run.
Debugging
Debugging is the process of fixing any errors or bugs that testing
reveals.. IDEs integrate several debugging tools that highlight bugs
caused by human error, often in real time as the developer is typing.

4(d)
Compiler is the software that translates the program written in a
high-level language to machine language. The program written in
high-level language is referred to as the source code and compiled
program is referred to as the object code. When creating a program,
the compiler takes the human readable code and then converts it
into object code. This object code is written in assembly code. The
compiler performs various checks and optimization during this
process. The object code is then passed onto the Assembler, which
takes the object code and turns it into machine code. The assembler
assigns memory to the variables and instructions in the code.
Machine code created by the assembler is platform dependent and
code from one architecture does not work on another. Since a
project may contain multiple different modules and libraries, all of
them are converted to object code using the process above and then
sent to the linker. The linker takes all the modules and resolves
references between them and assigns absolute memory locations to
everything, The linker then produces a binary executable that can be
run on the target computer or architecture.

You might also like