Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chap 1 : Data representation - Coggle Diagram
Chap 1 : Data representation
Number systems
1.1 Binary represents data (Binary number system)
+basic building block : all computers
why chosen?
+consists 1s, 0s (= On/Off states in Computer system)
explaination
Based : number 2; use 2 values : 0 and 1 => bits
binary heading : 2^0, 2^1,....
examples
8-bit system : 2^7 (128); 2^6 (64); 2^5 (32) .... 2^0 (1) (!cao đến thấp ~ order)
a typical binary number : 0 1 1 1 1 0 0 1 (! 2^0 last one)
! maximum in exam : 16 bits
types (3)
Binary, denary and hexadecimal number systems
Denary system
A base 10 number system + column headings : 10^0, 10^1...
Hexadecimal system
based : number 16 (16 digits ~ 0->9 + letter A->F~ 10-15) + headings : 16^0,16^1,...
1F3A =
calculations
convert Binary to ...
binary --> denary (add)
example
0 1 1 1 0 1 0 0 = 64 + 32 + 16 + 4 = 148
method
add together all heading : a 1-value appears
binary -> hexadecimal
binary
split binary number -> 4-bit groups (right + left); each 4-bit ~ a hexadecimal digit + start with rhside (normal order) (feels like : covert to denary -> hexa)
example
1001 1111 -> 9 15 -> 9F (A=10, tổng 15 số)
left-most group : 111 => infill 0 in left
convert Denary -> ... (Div)
Denary -> Binary (div)
exam
answer : 111011, ! if 8-bits required => infill 0 (=0111011)
method
positive denary -> binary : divide by 2, take remainder each time until result : 0 + read remainders : bottom -> top
Denary -> hexa (div)
successive divisions | 16 until : 0 (result), each remainder : bottom --> top
2004 -> 7D4
hexadecimal -> ...
Hexa --> binary
write 4-bit binary code for each hexadecimal digit
example
45A -> 0100 0101 1010
Hexa -> denary (x,+)
method
Hexa digit x its heading value, add all
Example
4EB5 = (4x16^3) + (14x16^2) + (11x16^1) + (5x16^0) = 20 149
! (all heading : from biggest --> lowest ~ rhs)
Uses : hexadecimal system
Theory + why?
often used | computer programmers + designers <- easy deal with (ex : AF01 > 1010111100000001)
Uses (5)
error codes (Sign + có link tới memory)
refer -- > memory locations : error occurs + automatically generated | computer
Media access control (MAC) address (địa chỉ vật lí only, gửi/nhận qua NIC nhờ this)
theory/def
identify devices on a network (via NIC) + format : NN-NN-NN-DD-DD-DD (first 6 : manufacturer code + serial number : device)
NIC (Network interface card) -> giúp kết nối vs mạng (LAN, Internet,..)
Internet protocol (IP) address (digital)
theory/def
given --> device when : join a network
types (2) 2^(4/6 + 1)
IPv4 (32-bit code)
IPv6 (128-bit code)
Hypertext mark-up language (HTML) colour codes
theory/def
colour : each pixel <- a combination (red + green + blue) + the amount of each color ~| a hex code
example
B1 89 04 : Tan colour
Addition : binary numbers
involves : a carry & a sum of 2-3 bits added (
)
Overflow
<- results : calculation is too large for : allocated word size
example
a word size : 8 bits ~ maximum value : 255 (2^8 - 1)
01101110 ~ 8-bit word size
overflow error
too big : stored in computer using 8-bit register
solution
greater number : bits -> represent larger number stored (16-bit : 2^16 - 1)
Logical binary shifts