Ports and cables:
I/O = input/output
Serial communication: 1 bit at a time
Parallel communication: many (8 or 32) bits simultaneously
Easy to convert from serial to parallel
1
0
1
1
0 (parallel) <---> 10110101 (serial)
1
0
1
__________________________________
Bi-directional communication using one cable
Simplex: one way
Half- Duplex: one way, then the other, then one (walkie talkies)
Duplex: both ways at the same time
__________________
Error detection -> request to resend data
Error correction -> the correct message is figured out
What's a parity bit?

A bit added to the end of a binary string to tell if the total number of '1' bits is even or odd.
We can choose between applying Odd Parity or Even Parity:
We can have more parity bits for better error detection.
After the sender sends the message, 'he' waits for the receiver to send the ACK (Acknowledge) signal. Just like 'seen' in facebook.
If ACK doesn't come in reasonable time the sender re-sends the message.
______
Error correction is possible:
- When we have many parity bits (Hamming code)
- When there's a limited number of code words (so the error will be something not interpret-able which we'll fix to the closest code word that 'makes sense')
- When we form block parity (parity bits in both rows and columns of a data matrix)
Hamming code: https://en.wikipedia.org/wiki/Hamming(7,4)
So beautiful :P
Many parity bits make the messages too large, and since our channels are fairly reliable we don't need that shit.
We want detection & re-transmission if possible because we don't have that many errors.
Correction is necessary when we can't re-transmit (like sending messages to the universe or writing CDs)
Parallel interfacing (parallel communication):
- Fast communication (simultaneous transmission)
- Into the circuit logic (the chip units have parallel I/O)
- Flexible interface
but
- It's expensive/clumsy/unsuitable for long distances
- Can't handle high speeds and distance because the bits have to arrive intact at the very same moment.
and there's bus skew, clock skew, crosstalk and electromagnetic interference
entering...
Serial interfacing:
- Just one wire which we can easily protect & extend.
- No skew
- No crosstalk if no other cables are too close.
- limited electromagnetic interference if we use differential signaling
In differential signaling we use two complementary signals (two cables, typically twisted together).We 'break' the same electrical signal to a differential pair of signals, each in its own cable.
The receiving circuit responds to the electrical difference between the two signals, rather than the difference between a single wire and ground.
The opposite technique is called single-ended signaling.
So, in parallel we have simple cables, smaller connectors, popular standards (like USB) and somehow better cooling inside the computer.
Famous obsolete parallel protocols:
Centronix, IEEE-488, SCSI, ATA
Famous serial protocols:
USB, serial SCSI, PCI express, sATA
The memory is a large indexed set of memory cells.
A memory cell is the smallest part of a computer memory that can be changed in a single operation.
A memory cell has an address. That's a unique identification number and never changes.
Each cell has ONE bit of content.
The cell address answers the question:
WHERE is the cell located in memory?
- - -
The cell content answers the question:
WHAT is stored in the cell?
The content can be:
- Numeric data
- Alphanumeric data
- Instructions
(or combination of instructions & data)
The bits are grouped:
1 byte = 8 bits
1 word = 32 bits (or 64)
We can not read or write individual cells.
The smallest unit is a byte or a word, depending on the computer.
The more powerful the computer, the longer that elementary 'word' is.
That's the difference between 32-bit and 64-bit processors, they can access the same memory in different ways (64-bit ones are more greedy and need software built to utilize that ability)
The memory is organized in memory matrices (cell arrays).

Each row is a word (e.g 8 bits, so 8 columns), I'm confused here.
The decoder (not shown, left) bring the information of which addresses to select in the line of elements.
I'm not gonna learn & explain what's happening with that.
Memory cell arrays are organized in packed modules.
Word length = the number of data bits = width of data bus = width of the internal CPU registers
Address length: Determines how much memory can be addressed, for example, with 32 bits we have 2^32=4.3 billion bytes/words.
Notation of orders magnitude
10 to the power of...
Kilo: 10^3 (thousand)
Mega: 10^6 (million)
Giga: 10^9 (billion)
Tera: 10^12 (trillion)
Peta: 10^15 ...
Exa: 10^18 ...
Zetta: 10^21 ...
Yotta: 10^24 ...
e.g 1 Terabyte = 1000 Gigabytes
Be careful! Mbit and MB are different! Megabit is one million bits and Megabyte is one million bytes = 8 Megabits
we also have KiloBinary which is the concept of two to the power of 10,20,30 etc
Kibi: 2^10
Mebi: 2^20
Gibi: 2^30
etc
Have another short break, stretch, hop, contemplate your misery.
Rrrepresentation of informationay!
Information can be
Numeric data:
Integers: 0, 1, 2, 3...
Signed Integers: -2, -1, 0, 1, 2, 3...
Floating point numbers: 1.32, 5.03, 23.555
Alphanumeric data: A, b, 7, &, $, φ
Instructions: operation codes & operands and how to deal with all that mess.
Number systems depend on how many digits you we use:
2 digits: binary (0,1)
8 digits: octal (0,1,2,3,4,5,6,7)
10 digits: decimal (0,1,2,3,4,5,6,7,8,9)
16 digits: hexadecimal: (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
notation: (234)8 -> octal number system
Converting binary to decimal.
Example:
(1101)2 = 1*2^0 + 0*2^1 + 1*2^2 + 1*2^3 = (13)10
Max n-digit binary numbers are like 1111...1
(just like biggest n-digit decimals are 9999...9)
With n digits of a binary number we can create 2^n integers.
Don't forget that the 1st integer is zero so the biggest decimal integer we can represent is 2^n-1.
For example, with 8 bits we have 2^8-1 = 0,1,2...63
____
If we group by 3-bits we can form digits of octal numbers.
e.g 001001100011100001111 = 001 001 100 011 100 001 111 = (1 1 4 3 4 1 7 )8
If we take group by 4-bits we can form digits for hexadecimal numbers.
e.g (same sequence) 01001100011100001111 = 0100 1100 0111 0000 1111 = (4 C 7 0 F)16
________
The most convenient & efficient way to represent negative integers with the 2-complement.
The first bit is the sign bit (0-positive, 1-negative)
How to create a negative integer (with n-complement):
1. Take the positive binary integer as usual
2. Inverse all the digits
3. Add 1
For example, 4 and -4:
step 1: (4)10=(0100)2 (notice the extra '0' bit for the sign)
step 2: invert -> 1011
step 3: add one: 1100 = (-4)10
We can add 2-complement integers without problem...
as long as the sum doesn't exceed the largest possible number (in which case we have overflow error).
___________
ALU (Arithmetic Logic Unit) detects overflow.
When decreasing the register length (the bits used to represent a value) we must be sure the number and the sign fit in the fewer bits.
Floating point numbers
Normalized notation:

Decimal floating point numbers:
e.g (1.123)10 =
take a standard form: A.BCD... *10^exp
Where A > 0.
the A.BCD... part is Mantissa
and exp is the Exponent
Binary floating point numbers:
e.g(1.011)2
take a standard form A.BCD... *2^exp
Where A > 0, so A = 1.
the A.BCD... part is Mantissa
and exp is the Exponent
Of course we have limited digits both in the mantissa and the exponent.
- When we don't have enough exponent digits to represent the magnitude of the number we have overflow.
- When we don't have enough digits (in the mantissa) to represent the needed precision of the number we have underflow.

Rounding errors:
For the computer 1/3 is 0.3333(depending on the size of the mantissa) but that's not the real value.
The standard IEEE 754 for binary floating numbers:
Form: ||sign|exponent|fraction|bias||
Single precision:
||sign=1|exponent=8|fraction=23||
total 32 bits to store (bias=127)
Double precision:
||sign=1|exponent=11|fraction=52||
total 64 bits to store (bias=1023)
The fraction is normalized, so the first bit is always 1
Range
Single precision: 2.0 x 10^-38 … 2.0 x 1038
Double precision: 2.0 x 10-308 … 2.0 x 10308
The exponent sign is represented by adding a bias.
Two exponent values have a special meaning:
00000000 :value 0
11111111: NaN (Not a Number)

___________________________
Alphanumeric data: Letters, digits, punctuation, control characters, symbols.
7 bits represent 2^7 = 128 characters
Standards:
ASCII (American Standard Code for Information Interchange) uses 7 bits
Unicode comes in 3 different encoding forms:
UTF-8: Variable length code. Compatible with ASCII
UTF-32: Fixed width. Takes up a lot of memory. Easy Access.
UTF-16: Middle solution. Efficient access in limited storage.
_____
Opcode (operation code) is machine language instructions that define operation to be performed.
Examples: ADD, AND, NOT, OR, ESC.
Opcodes are followed by the operands they will act upon.
TAKE A BREAK, HAVE A CUP OF GREEN TEA
Ready?
_______________________
Digitizing sound:
Each sample takes a binary value.
We take discrete samples of the continuous analog amplitude every some time.
That's the Sampling Frequency.
If we take samples more often, we have better quality (and bigger sound file):
Examples:
Phone/real time sound streaming: 8000Hz (8000 samples per second)
CD: 44100 Hz
Digital TV, DVD: 48000 Hz
If we use more digits (more detail/accuracy) for each amplitude measurement we have again better quality (& bigger file).
That's the bit depth.
Examples: 16bit, 32bit
Remember, in stereo we have two channels.
Aliasing is an error we get with sampling in too low frequency.
In order to avoid aliasing we have to sample with at least 2 times the maximum frequency of the signal.
For example, the human can hear <20kHz
So we need sampling of >40kHz
If that's so, why it's ok to sample voice with only 8kHz?
The usable voice frequency band ranges from around 300 Hz to 3400 Hz, so sampling at 8kHz is enough.
Example: How much space we need to store 74 minutes of music with a sampling of 44100 Hz in 16bit sound depth?
We have 16 bits taken 44100 times every second for each channel (stereo).
That requires 16*44100*2 bits per second.
80 minutes are 74*60 seconds, so finally we need 74*60*16*44100*2 /8(bytes)= ... somehow I can't agree with his calculations though it's the very same numbers
There are two ways to reduce size.
Loseless compression: That's ways to represent exact the same data in a way that saves space.
Lossy compression: Here we lose non-important accuracy to save more space.
These apply to both sound and pictures/video.
______________________________
Color representation:
Our eyes have only three color receptor cells. For RED, GREEN and BLUE.
Since yellow half stimulates our green and red photo-receptors we can trick our perception selling red and green light together as yellow (just an example).
Our eyes have only three color receptor cells. For RED, GREEN and BLUE.
Since yellow half stimulates our green and red photo-receptors we can trick our perception selling red and green light together as yellow (just an example).
Each color is represented by a binary number.
Similar story, color depth is how many shades of Red, Green and Blue we store.
For example, in 8 bits we can store 2^8 = 256 different colors.
16-bit gives a range of about 64,000 colors (high color)
24-bit allows 24 million colors (true color)
True color still can't reach particular shades that are impossible to create with the RGB space.
In true color (32 bit) the bit distribution goes as following:
8 bits for 256 shades of Red
8 bits for 256 shades of Green
8 bits for 256 shades of Blue
8 bits for 256 transparency values (Alpha channel)
Our screens have a frame buffer, that's the memory to hold the image on the screen before it changes.
The amount of buffer needed depends on the screen resolution and the color depth.
For example if we have an 24bit Full HD screen we need
1920*1080*32 bits
______________
Memory types & characteristics
Memory types & characteristics
As the technology progresses, the processors' speed increases faster than the memory. There's a performance gap.
Memory speed is expressed in access time (in nanoseconds = 10^-9 sec)
DRAM uses capacitors: Access time: 70 ns +refresh (large & cheaper memories, like RAM)
SRAM uses flip-flops: 10-20ns, no refresh (smaller fast memories, like cache)
How to speed it up!
- Burst mode: Return several consecutive from single address request.
- Dual ported memory: Two simultaneous accesses to the memory.
- Change the architecture:
Add small but faster memoru (cache) between CPU and memory
Virtual memory Cache Memory CPU
Hard disk -> RAM -> L3->L2->L1 -> CPU
L1 faster than L2 faster than L3 faster than RAM faster than HDD
(and more expensive)
Most memory chips are volatile. That means that if there's no power (electricity) all the data is erased.
So, how does the CPU start up?
There's non volatile memory that contains the start-up programs.
There's non volatile memory that contains the start-up programs.
Volatile memory handles the applications we use after the computer is on.
ROM (Read Only Memory) is not volatile.
It's also fixed, can't change.
ROM contains the boot program that starts up the system and loads the basics.
RAM memory is packaged in physical memory modules.
_____
_____
No comments:
Post a Comment