topic 1 Flashcards

1
Q

what is a CPU?

A

Our CPU (or silicon chip or simply processor) is actually an integrated circuit (IC), which consists of millions of transistors interconnected by microscopic wires on a footprint of around 1cm^2 (transistors are the building blocks of electronic circuits)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

how is an intergrated circuit produced?

A

the designed IC will be etched onto a wafer of silicone. in order to counter errors in the production process, 100s of copies of the same IC are etched with each one called a die. The dies are tests and each error free die is cut and mounted in a package with the dies pads connected to package pins. this results in the silicone chip being encased in a package with the external contacts of the IC connected to the pins in the package to enable direct contact with other components within the PC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is the multicore processors?

A

multiple independent cores (CPUs) are manufactured on the same IC but these cores share things like main memory, due to technological limitations only a few are used today. Future technological advances will lead to multi-core processors with hundreds of cores becoming many-core processors. In order to utilize this programmer must think parallel rather than sequentially

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what does moores law state?

A

Moore’s law states that the transistor capacity of an IC doubles every 18-24 months. - rough description of a long-term trend,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are the flaws of mooores law?

A

there is a fundamental limit on the number of transistors as when it reaches the atomic scale they wont be able to decrease further. Power dissipation is an issue due to the fact power is proportional to the number of transistors switched multiplied by the frequency of the switching ie the clock speed of the CPU. Therefore, as the number of transistors increase so does the power usage therefore power dissipation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

why might multiple core processors solve the issue of power dissipitation?

A

Power dissipation is an issue due to the fact power is proportional to the number of transistors switched multiplied by the frequency of the switching ie the clock speed of the CPU. Therefore, as the number of transistors increase so does the power usage therefore power dissipation. multi-core processors solve this as instead of using one high clock speed CPU they can use multiple lower clock speeds which work together and give better computational power

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what are the three fundamental logic gates?

A

NOT, OR, AND

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is a logic gate?

A

small circuits made up of transistors – can be used to store Boolean values such as 1 or 0 interpreted by a low or high voltage therefore creating a Boolean output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

how many transistors does it take to build an NOT gate?

A

2 transistors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how many transistors does it take to build an AND gate?

A

6 transistors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how many transistors does it take to build an OR gate?

A

6 transitors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

how many transistors does it take to build a NAND gate?

A

2 transistors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

why might the NAND gate be considered the fundamental logic gate?

A

this is due to the fact that a NAND gate can be used to create all the other logic gates .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how can a NAND gate create a NOT gate?

A

the NAND gate can create a NOT gate by duplicating the inputs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how can a NAND gate create an OR gate?

A

A NAND gate can form an OR gate by a NAND gate where the two inputs are prefixed by a NOT gate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

how can a NAND gate create an AND gate?

A

A NAND gate can form an AND gate by having a NAND gate followed by a NOT gate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

is it true that for any given function we can compute the function using just NOT AND and OR gates?

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

what is binary system?

A

binary uses power of 2 to signal its numbers with 2^0 at the furthest to the right and in increasing maginitude the further left. for example 001 is equal to 1 and 101 is equal to 5 as 2^2 +2^0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

what is the purpose of a half adder?

A

the half adder takes inputs X and Y and calculates the boolean sum of the two values. The Boolean sum of a collection of inputs is 1 if, and only if, an odd number of the inputs are 1, and also the resulting carry bit c(x, y), which is 1 if, and only if, both x and y are 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

what is the purpose of a full adder?

A

a full adder takes the inputs X Y and C and computes the boolean sum together with a carry bit D which is 1 only of atleast two of the inputs are 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

what is a full adder made of?

A

two half adders and an OR gate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

what is the arithemtic logic unit?

A

it is a part of the CPU which performs all the arithmetic and logical operations on data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

what is the datapath?

A

The datapath performs all the data processing operations (it is the ‘brawn’ of the processor) and includes the arithmetic logic unit. The datapath includes (a limited number of) memory locations called registers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

what is the control?

A

The control tells the datapath, memory and input/output (I/O) de-vices what to do (it is the ‘brains’ of the processor). Essentially, the control is the conduit( the way of passing information) between the datapath and the main memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

what is the cache?

A

A cache consists of small, fast and relatively expensive on-chip memory. Data caches are used to store memory items that need to be regularly accessed (sometimes there is more than one such cache). Similarly, instruction caches are used to store instructions that need to be regularly executed (we’ll say more about caches later)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

what is the key aspect of von neumann architecture?

A

A key aspect of the von Neumann architecture is that the stored program and the data are both held in memory, which allows for self-modifying programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

what is a flaw with von neumann architecture?

A

programming errors might result in a program obliterating itself or modifying itself in unintended ways!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

what are the three types of buses?

A

data bus, address bus, control bus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

what is a bus in computer science terms?

A

a bus is simply a communications device that can be thought of as a series of ‘parallel wires’ down which data can flow, with the number of these ‘wires’ being the width of the bus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

what is a von neumann bottleneck?

A

a limitation in the data transfer rate between the CPU and memory (as stated above, data and instructions have to be fetched in sequential order and the CPU spends a considerable time idle whilst waiting for data items or instructions to be fetched from memory).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

what did the von neumann bottleneck give rise to?

A

it gave rise to the use of caches

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

what is the harvard architecture?

A

The Harvard architecture, where memory is partitioned into data memory and instruction memory with dedicated buses for each of them, does not suffer from the von Neumann bottleneck Now, as the program instructions and data items can be fetched simultaneously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

what is a modified harvard architecture?

A

data memory and instruction memory are separated, each with their own dedicated bus, the processor allows data to be treated as instructions and instructions to be treated as data; this allows for self-modifying or self-optimising code. In addition, there are separate CPU caches for instructions and for data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

what is memory?

A

memory is a set of pigeon holes into which data can be placed. each pigeon hole has a unique address and holds 1 byte of storage( 8 bits either 1 or 0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

what is the role of the address bus?

A

The address bus holds addresses of locations in main memory. The width of the address bus determines the size of addressable memory. For example, an address bus that is 32 bits wide can carry at most 2^32 different addresses. So, as each memory address holds 1 byte then addressable memory has size 4 Gbytes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

what is the role of the data bus?

A

The data bus carries the contents of memory locations. The width of the data bus determines the word-size of the computer. Note that although each memory location holds 1 byte of data, a computer with a word-size of 32 bits, for example, can be considered to hold 32 bits of data in each location, for the contents of some ‘location’ are considered to consist of the contents of 4 contiguous bytes of memory.

36
Q

what is the role of the control bus?

A

The control bus is used to transfer information between the CPU and various other devices within the processor. Typical information includes signals saying whether data is being read or written and de-tailing information transmitted from input/output devices.

37
Q

what is the relationship between cost and performance of memory and physical distance from the cpu?

A

The cost and performance of memory is generally proportional to its physical distance from the CPU.

38
Q

what is the hard disk?

A

The hard disk usually consists of rapidly rotating disks with magnetic heads (although solid state drives, which have no moving parts, are becoming more common). Hard disks are used for secondary storage and tend to be cheap but relatively slow.

39
Q

what is dynamic RAM?

A

Dynamic RAM (DRAM) is where a bit of data is stored using a transistor/capacitor combination. It is relatively cheap although it needs to be refreshed (because capacitors tend to ‘leak’) and is slow.

40
Q

what is static ram?

A

Static RAM (SRAM) is where a bit of data is stored by a flip-flop, which incorporates 4-6 transistors. It is stable and fast although takes up more space.

41
Q

what is caches?

A

Caches are expensive memory that are used to store rapidly accessed items. They are generally organised hierarchically into levels. A level1 cache usually consists of static RAM and is built into the CPU. A level 2 cache again usually consists of static RAM and might be either built into the CPU or be at a short physical distance away.

42
Q

what are registers in computer science terms?

A

Registers are on-chip memory locations that are limited in number(the actual number results from a design decision) and are the ‘bricks’ of computer construction. Processor registers are at the top of the memory hierarchy and provide the fastest way to access data.

43
Q

what are the accumulator?

A

The accumulator is a special register which temporarily stores the results of arithmetic and logical operations (on data in registers).

44
Q

what are the program counters?

A

The program counter is a special register that holds the memory address where the next instruction can be found.

45
Q

what is the basic processor operation fetch-decode-fetch-execute cycle?

A

the ‘instruction fetch’ phase involves the supply of the instruction ad-dress (via the address bus) and the return from memory (via the data bus) of the instruction;
* next, the ‘instruction decode’ phase involves interpreting the stored instruction within the CPU;
* next, the ‘operand fetch’ phase involves the supply of the address of any required data (via the address bus) and the return from memory(via the data bus) of this data; and finally
* the ‘execute instruction’ phase involves the CPU performing the necessary actions (this phase is sometimes split into two with the ‘execute instruction’ phase followed by a ‘write-back’ phase where data is writ-ten back to memory, if needs be)

46
Q

what occurs during the instruction fetch stage?

A

The CPU outputs the value of the program counter (the address of the next instruction to be executed) on the address bus. Memory reads the address bus and puts the contents of the particular memory address onto the databus; that is, the instruction to be executed. The actual instruction is stored in instruction registers within the CPU.

47
Q

what occurs during the instruction decode stage?

A

The instruction word stored in the instruction registers is decoded by the internal logic to provide control signals to the ALU and to other internal circuits inside the CPU. These control signals essentially tell the ALU what to do in order to execute this instruction. The program counter value is pushed onto the address bus. The ALU (having read the program counter from the address bus) increments this value by the word-size (in bytes) and puts it back into the program counter; so, the program counter now contains the address in memory of the next instruction to be executed (or so it thinks).However, and as we’ll see, the value in the program counter might change.

48
Q

what occurs during the operand fetch?

A

The instruction registers provide the address of the data to be processed to the address bus; that is, the operand address. Memory supplies the operand data to the data bus and thus to the CPU, ready for processing by the ALU.

49
Q

what occurs during the execute instruction stage?

A

Processing is performed on the operand by the ALU, according to the instruction, and the result (if any) is put back into the accumulator. Also, it might be the case that the program counter is updated; for the instruction just executed might have been a branch instruction and the next instruction might actually be in a different memory location to that expected.

50
Q

what occurs during the write back stage?

A

The result from the accumulator is written back into memory (via the databus). In many processors, the write-back is separate from the execute.

51
Q

how does shared memory work in multicore processors?

A

shared-memory, where different processors communicate with one another by writing and reading messages left in shared-memory locations

52
Q

how does distributed memory work in multicore processors?

A

processors are connected according to some interconnection net-work (e.g., as a ring or a mesh) and communicate by message-passing.

53
Q

what are the advantage of multicore computing about power?

A

Multi-core computing allows for the use of more and slower processors, with a consequent drop in heat generation and power consumption in comparison with one fast, high-power processor.

54
Q

what memory architecture is general purpose graphics processing units?

A

GPGPU are shared memory devices

55
Q

what is the instruction set architecture?

A

the interface between hardware and software. It is the view the programmer has of hardware and includes everything programmers need to know in order to control the processor/

56
Q

what are the different parts of the ISA?

A

the organisation and structure of programmable storage (namely the registers and main memory that is useable by the programmer);
the instruction sets and formats (namely the processor instructions available to the user in order to access and manipulate data residing in memory);
the methods for addressing and accessing data items within memory, e.g., absolute (‘go to this location’), indirect (‘go to the location stored in this location’), using offsets (’go to this location plus this offset number’); and*
the process of execution, e.g., the fetch-decode-fetch-execute cycle.

57
Q

what is the primary component of the instruction set archistructure ( ISA)

A

the assembly language, a high-level program is compiled first into assembly language and then into machine code. Assembly language instructions are very low-level and facilitate the subsequent translation into machine code.

58
Q

what is the typical ISA?

A

MIPS, microprocessor without interlocked pipeline stages

59
Q

what are the assumptions about MIPS

A

We assume that:
* memory has 232 memory locations (so, our address bus is 32 bits wide);
* words are 4 bytes long (so our data bus is 32 bits wide);
* when we request the contents of a memory address m, the contents of memory locations m, m + 1, m + 2 and m + 3 are returned; and* there are 32-bit registers $zero (which always holds 0), $s1, $s2, . . .,$s7.

60
Q

what is an operating system?

A

An operating system provides the interface between different programming applications and hardware. the operating system manages a machine’s resources, e.g., processor cycles, memory and devices such as modems, disks, network interfaces, video interfaces and so on, so that they are used efficiently and safely.

61
Q

why is an operating system needed?

A

The whole need for an operating system resides around the fact that although a computer generally has one CPU, nevertheless it is concurrently undertaking a whole series of tasks (even when a computer has more than one processor, there are usually more processes executing than there are processors).

62
Q

what are the main functions of an operating system

A

1- it virtualises a machine
2- it starts and stops programs
3- it manages memory
4-it handles input and output
5-it maintains and provides access to the file system
6- it deals with networking
7- it maintains security
8- it facilitates error handling and recovery when programs dont do what they are supposed to

63
Q

how does the operating system virtualise he machine

A

Hardware has low-level physical resources with complicated, idiosyncratic (individual or peculiar) interfaces. An operating system provides abstractions that present clean interfaces so as to make the computer easier to use. Also, virtualization means that the operating system can make a physical machine behave like an idealised virtual machine so as to aid portability.

64
Q

how does the operating system start and stop programs?

A

The operating system starts and stops programs. For example, it ensures that when a program is stopped, the memory allocated to this program is freed up for use by other programs and the processor is al-located to some other task (which is presumably in some queue waiting for processor access)

65
Q

how does the operating systems manage memory?

A

the operating system manages memory. To see what we mean by this, consider compiling some C program. The compiled program will require memory so that it might run. However, it may be that the memory required is already being used by some currently executing program. The operating system will ensure that the compiled C program can still run by using memory that the compiled program thinks is the memory requested whereas in reality the memory actually used is different.

66
Q

how does the operating system handles input/output

A

The operating system handles input/output. Whilst programs are running, users are typing on keyboards, outputs are being sent to screens and so on. The operating system ensures that all of these activities are coordinated. For example, an operating system handles interrupts
which might be caused, for example, by pressing some keyboard key and result in the execution of some program being paused or aborted.

67
Q

how does the operating system maintain and provide access to the file system?

A

The operating system maintains and provides access to the file system. It ensures that programs and users only have access to their own files and not those of others, and that users can access their files in a well-structured way.

68
Q

how does the operating system deal with networking?

A

The operating system deals with networking. For example, it continuously monitors the network for incoming traffic and sends data packets as output when requested by some program.

69
Q

how does the operating system maintain security?

A

it maintains security through firewalls and tries to ensure that executing programs dont have access to parts of the system from which they can cause damage

70
Q

what are the three types of instructions?

A

the I type instruction , the R-type instruction and the J type instruction

71
Q

what does the I type instruction involve?

A

an I-type instruction involves data transfer:
∗ addi, lw, beq

72
Q

what does the R type instruction involve?

A

an R-type instruction works on registers:
∗ slt

73
Q

what does the J type instruction involve?

A

a J-type instruction involves jumps:
∗ j

74
Q

what does a process consist of?

A

a process consists of a thread or threads (of execution)together with an address space

75
Q

what is a thread?

A

a thread is a sequence of instructions in the context of a sequential execution (that is, a coordinated execution resulting from some program)

76
Q

what is an address space?

A

an address space consists of some memory locations (in main memory) that the corresponding process can read from and write to.

77
Q

what is the problem of mutual exclusion?

A

that is, ensuring that two threads are not in the critical section at the same time, where the critical section is exclusive access to some shared resource such as a memory location.

78
Q

how can the life cycle of a process be represented?

A

it can be represented as a finite state machine

79
Q

what are the 5 stages of the life cycle of a process?

A
  • new: the process is being created;
  • ready: the process is not executing on the CPU but is ready to execute;
  • running: the process is executing on the CPU;
  • blocked: the process is waiting for an event (and so not executable);and
  • exit: the process has finished.
80
Q

what are the 6 state transistions in the life cycle of a process?

A
  • admit: the control overheads as regards a process have been set up and the process is moved to the run queue;
  • dispatch: the scheduler allocates the CPU to an executable process(the scheduler is the component of the operating system that deter-mines which processes should be run and when);
  • timeout/yield: the executing process is forced to/volunteers to re-lease access to the CPU;
  • event-wait: a process is waiting for an input/output event, for example, and gives up access to the CPU;
  • event: an event occurs and wakes up a process;
  • release: a process terminates and releases access to the CPU (and other resources)
81
Q

what is a process control block?

A

A process control block (PCB) is a data structure that the kernel uses in order to manage a process.

82
Q

what does a process control block consist off?

A
  • the process’s unique ID;
  • the current state of the process (new, exit, ready, etc.);
  • CPU scheduling information such as the process priority, whether there are events pending and so on;
  • the program counter, detailing the next instruction to be executed (this is only available for processes that are not running, having been paused for some reason);
  • the current values of other CPU registers (again, this is only available for processes that are not running, having been paused for some reason);
  • memory management information, such as the (current) location of the address space;
  • scheduling and accounting information, such as when the process was last run and the amount of CPU time that has elapsed so far; and* a reference to the next and previous PCB in the list of PCBs.
83
Q

what does an R type instruction consist off?

A

an opcode (operation code) , a first source register, a second source register, a destination register, a shift amount for shift instructions, a function

84
Q

what does a J type instruction consist off?

A

an opcode (operation code ) and an address is the memory to jump to

85
Q

give an example of a R type instruction ?

A

slt

86
Q

give an example of a J type instruction?

A

j

87
Q

give an example of an I type instruction

A

addi

88
Q

what does an I type instruction consist off?

A

an operation code, a source register, a destination register, an adress