Você está na página 1de 4

Weekly Summary #1

1/6/2015
The existence of hexadecimals where it counts like:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 00, 01, 02, 03
Hexadecimal values should end with the suffix H, and binary values should end wi
th the suffix B to avoid confusion.
E.g.
AH = 10
DH = 13
Conversion between:
Hexadecimal to Decimal
e.g. Find the decimal value of 11BC1
(From right to left start by writing)
16^4
16^3
16^0
Decimal
65536
4096
1
Hexadecimal
1
1
1
H
Working:
1 x 65536
1 x 4096
11 x 256
12 x 16
1 x 1

=
=
=
=
=

16^2

16^1

256

16

65536
4096
2816
192
1
72641

Decimal to Hexadecimal
e.g. Find the decimal value of 1321
(List out the values of base 16 again starting with 160 from the right and stop
at the value that is larger than the decimal given, in our case 1321)
16^3
16^2
16^1
16^0
Decimal
4096
256
16
1
Hexadecimal
?
?
?
?
Start with dividing 1321 by 256 to know the hex value and ignore the decimals.
Then use 1321 mod 256 to find the remaining value.
(1321 is smaller than 4096 we can omit that number)
1321 / 245
=
5
<- Hex value
1321 % 256
=
41
<- Remaining value
41 / 16
=
2
<- Hex value
41 % 16
=
9
<- Remaining value
9 / 1
=
9
<- Hex value
9 % 1
=
0
<- COMPLETED
The hexadecimal value of 1321 is 529H!
Binary to Decimal
This should be simple and straightforward. Just like the above hexadecimal to de
cimal but only replace base 16 with base 2!
Decimal to Binary
Like the above decimal to hexadecimal but only replace base 16 with base 2!

Addition and Subtraction of Hexadecimal, and borrowing of values when the left s
ide.
Note: Don t forget the 0! As it might screw up with your calculations while borrow
ing.
Computers use binary to operate (0 and 1) and Hexadecimal is here to help us sho
rten the characters that are required to type by us.
1/7/2015
The Art of Compiling:
Editor to write code
Save code
Compile Code
o
Preprocessor runs
?
#include <iostream> (pulled in and dumped into the code)
o
Compiler runs
?
Lexes
?
Parses
?
Builds a tree
?
?
Emits an Assembly Fil
o
Assembly file gets sent to the assembler
?
Assemble runs
?
Emits object file (.o)
o
Linker Links
?
Create executable
Also, in class we talked about loop on rolling which is the assembler copies eac
h loop (for loop only!) and the loops are stated explicitly.
.data is used for globalized initialized variables
.bss (Block Started by Symbol) contains uninitialized variables
.text is where the real code lives in
1/8/2015
Relay is a mechanical switch that is operated by electricity, for controlling el
ectricity.
Transistors are tiny crystals of silicon that uses electrical properties of sili
con to act as switches.
The transistor switch and its support components are called a memory cell.
A memory cell, holds one binary digit, 1 or 0.
(Before Random access memory was formed) Serial-access devices present their bit
s in a fixed order, one at a time. We would have to wait for the one we want to
come up in its order. (Hard-drives)
Random access memory, every bit is assigned an address for easier access.
Address pins are applied with addresses with binary numbers.
-A bit is a single binary digit, 0 or 1.
-A byte is 8 bits side by side
-A word is 2 bytes side by side.
-A double word is 2 words side by side.
-A quad word is 2 double words side by side
When computer applies memory address to 20 address lines that are connected toge

ther in parallel, the address appears on the address pins of all eight memory ch
ips.
Computer s memory consists of one or more row of memory chips, each chip containin
g a large number of memory cells made out of transistors and other electrical co
mponents.
When the CPU reads a byte from memory, it places the memory address of the byte
on its address pins, encoded as a binary number. The requested byte appears also
as a binary number, on the data pins of the memory chips.
When the CPU writes a byte, it first places the memory address where it wasn t to
write onto its address pins. The CPU places the byte it wants to write into memo
ry on its data pins later. The memory system stores the byte at the requested ad
dress.
Quick note: The CPU passes an address to the memory system, and the system eithe
r accepts data from CPU for storage at the address or places data found at that
address on the computer s data bus.
Data bus form a line to links the CPU with all other part of the computer. (Peri
pheral such as USB or graphic boards.
For data bus to communicate with the other peripherals, an address is placed on
the bus, follow by some data. Special signals go out on the bus with the address
to indicate whether the address represents a location in memory or one of the p
eripherals. Address of peripheral is called an I/O address.
The CPU s immediate work-in-progress is held in temporary storage containers calle
d registers.
Registers can be accessed fast, which includes storing and reading. Made out of
transistors, they do not have numeric addresses, but they have individual names.
Simplified description for assembly lines:
Information enters the computer through a network port peripheral, which assembl
es bits received from a computer network cable into bytes of data representing c
haracters and numbers. The network port then places the assembled byte onto the
data bus, from which the CPU processes and place it back on the data bus. Periph
eral such as the display board then retrieves the byte from the data bus and wri
tes it into video memory so that it appears on screen.
A special register called the instruction pointer inside the CPU contains the ad
dress of the next instruction to be fetched from memory and executed. Each time
instruction is completed, instruction pointer is updated to point to the next in
struction in memory.
Transistor switches inside the CPU coordinate with the pulses generated by the s
ystem clock.
Machine instructions are binary pattern designs for coordinating electrical swit
ches, not numbers.
Gates which functions upon logic are used to build complex internal machinery wi
thin the CPU.
The collection of gates can add two numbers in a device called adder.
There are machine instructions that change the order in which machine instructio

ns are fetched and executed.


The CPU s architecture is constantly evolving in quantum leaps, 16 bits to 32 bits
to 64.
Ways of improving CPU architecture includes:
Increasing processor throughput which increases the number of instructions that
the CPU can execute over time, and reducing power consumption to avoid damaging
the CPU chip and surrounding components.
Electrical mechanisms which the CPU does as its instruction tells it do are call
ed the CPU s micro-architecture.
An operating system is a program that manages the operation of a computer system
.
The idea of using ROM (read-only memory) memory chip was used by IBM as ROM reta
ins data whether on or off. This enables the pc to use more than one software at
a time. The software used on the ROM was called Basic Input/Output System (BIOS
) and was named a firmware later on.
As memory gotten cheap by 1995, the operating system Windows 95 introduced preem
ptive multitasking which gives each program in memory it s time to run one softwar
e after another.
Linux, which the core was a block of code was called a kernel. System memory was
tagged as either kernel space or user space, and nothing in user space can writ
e or read anything stored in kernel space.
Graphical shell and ordinary applications run in user space, whereas peripherals
such as hard disk driver and display driver runs in kernel space which has prot
ection. All of this components are given a small slice of execution time.
PCs began to support the use of multiple CPU chips in a single system, through a
mechanism called symmetric multiprocessing. E.g. when two CPUs are available, t
he operating system runs its own code in one CPU, and user-mode applications run
in another.

Você também pode gostar