2. Data manipulation Flashcards
how are computers built?
there are many ways to build a computer but most of computers are built with funoimen architecture
what are parts of a computer architecture?
- the main part is called CPU (central processing unit.
- communication channel (Bus)
- Main memory (RAM)
what are CPU’s parts?
- Arithmetic/logic unit
- Control unit (styr enhet)
- Registers (arbetsminne)
what is Stored program concept?
The idea of storing a computer’s program in its main memory. (how is the program is going to do a task)
What are Machine Language?
It is a set of all machine instructions recognized by the CPU.
What is a Machine Instruction?
A machine instruction is an instruction encoded as a bit patterns recognized by the CPU. To run tasks and operations
where does a machine instruction gets the code from?
There are a set of codes that are implicated in the arbetsminne.
Is there many machine languages?
There is machine language for each different CPU. (It is specific to the CPU)
what are the the different architectures?
There are two:
- RISC (reduced instruction set computer) which have few, simple, efficient and fast instructions, for example ARM-based CPUs in smartphones.
- CISC (complex instruction set computers) which have many, convenient and powerful instructions, for example Intel-CPUs in laptops.
what are machine instruction categories?
- Data transfer instructions move data from one location to another, for example one move data from RAM to arbetsminnet and when its handled it moves back. (LOAD-instructions and STORE-instructions)
- Arithmetic/logic instructions tells the control unit to request an activity within arithmetic/logic, for example Boolean operations AND, OR, XOR as well as ADD and division. SHIFT and ROTATE
- Control instructions direct the computation of the program rather than the manipulation of data, for example when we have terms such as If… go back to step four and so on. JUMP-instructions which direct the CPU to execute another than the next one.
ADD signed integer instruction
00011010
+
01001001
=
10000000
+
01000001
=
00011010 / 26
+
01001001 / 73
=
01100011 / 99
_________________
10000000 / -128
+
01000001 / 65
=
11000001 / -63
SUB signed integer instruction
01001001
=
01000001
=
01001001 / 73
=
00011010 / 26
__________________
11000001 / -63
-
01000001 / 65
=
10000000 / -128
Overflow:
00000011/ 3
=
01111111 / 127 (overflow)
Program execution:
When a program is executed it is executed in machine cycles.
Three steps
-Fetch: Retrieve the next instruction from memory and the increment the program counter
-Decode: decode the bit patters in the instruction register.
- Execute: Perform the action required by the instruction in the instruction register.