计算机最终考试主题
计算机最终考试主题
Turing machine
abstract machine to stimulate math operations, foundation of modern computers
has tape, controller(acts like CPU; can move), and read/write head
Computer components
hardware> physical parts of computer such as
● internal hardware: CPU, motherboard, network card, video card, HDD, SSD
● external hardware: flat-panel, printer, speaker, keyboard, mouse, flash memory
software> consists of sequence of instructions, operating on one or more data items, tells hardware
components what to do
data> distinct information which computer system deals with, stored in binary. can be organized in many
data structures:
Chapter 2
Positional Number System
hexadecimal system
base r=16, representing four bits
10 base digits 0-9, letters A-F for numbers 10-15
octal system
base r=8
Conversion between Decimal, Binary, Hexadecimal, Octal (include the real number)
1. bases to decimal> determine place value, multiply each digit with place value, ass products
2. decimal to bases> repetitive division to convert integral part, repetitive multiplication for fractional part
● repetitive multiplication> multiply decimal with base, if 1 appears output 1, repeat until output 0.00
or infinite
3. binary-hexadecimal
four bits> one hexadecimal
divide binary numbers to four bit patterns, convert each 4-bit to one hexadecimal
4. binary-octal
three bits per one octal digit, divide per three bit groups and convert
5. octal-hexadecimal
translate to binary first then hexadecimal/octal
Chapter 3
unsigned/signed representation of integers
unsigned
an n-bit unsigned int can represent 2^n distinct int
signed
1. 2’
2. 1’
m-bit location can represent numbers from -(2^m-1 -1) to +(2^m-1 -1)
𝑚−1 𝑚−1
−2 − 1 𝑡𝑜 2 −1
m-bit location can represent numbers from -(2^m-1 -1) to +(2^m-1 -1)
there are two zeros -0 and +0
𝑚−1 𝑚−1
−2 − 1 𝑡𝑜 2 −1
Normalization
Normalization is needed to set same standard for all mantissa, because exponents can be done in
different ways
Biasing technique
Storing value in fixed space
Using IEEE 754 precision format, so add 127 to all exponents
Sign Exponent 8 bits Mantissa 23 bits
1 bit
Exponent explained using unsigned value
implicit
(101.101)2 > 1.01101 x 2^2
Convert back to number
𝑠 𝐸−𝑏𝑖𝑎𝑠
− 1 𝑥1. 𝑀 𝑥2
Sign Exponent 2 is 2+127 = 129 Mantissa
0 1 0 0 0 0 0 0 1 0 1 1 0 1
UTF-8
To represent every character in the world for international use, the Unicode character set was
developed. Unicode uses 16-bit (to represent over 65 thousand characters (65,536)) and
includes all the characters of the extended ASCII as its first 256 characters.Today, Unicode is
widely used by many computer systems and programming languages.
UTF-8 is the encoding system used by unicode
Huffman encoding
AABBCCCCEEEEEDDAEE
A:3
B:2
C:4
D:2
E:7
Make tree
Ex: A = 1 1
There are 3 A’s so 2x3 = 6
Then add with different letters
Compress ration
𝑜𝑔 − 𝑐𝑜𝑚𝑝
𝑜𝑔
Original = bits*characters for huffman
Chapter 4
Logical operations at pattern level
Unary operator:
NOT 0>1
Binary operator:
AND 1 1>1 can unset bits
OR 1 0>1 setting bits to 1
NAND 1 1>0
NOR 0 0>1
XOR 0 1>1 flipping specific bits (add 1 to flip, 0 to leave unchanged)
XNOR if bits not equal = 0
Subtraction
(A)-(B) = A + (-B)
Negative of B taken with one complement aka flipping all, then add one or two complement
sekalian
00100010 = 11011101 = 11011110
Then add with A, result done two’s complement then add - sign to result
Overflow
When value is out of range of allocation, two kinds:
- Positive overflow
- Negative overflow
Subtraction
underflow
Chapter 5
Main components of a computer
- Processing unit
● Uniprocessor (one processor per system)
● Multi-core processor (two or more independent cores to circuit)
- Main memory
- input/output subsystem
Set of registers
Registers
Limited storage capacity, but high speed to read or write
Three most common include:
- Data register
- Instruction register IR
- Program counter register PC
Memory
Main memory consists of collection of cells, with unique physical address
Address space: memory size any computer entity occupies
Two types:
- RAM random access memory> volatile
- Divided into static RAM SRAM, and dynamic RAM, DRAM
- ROM read only memory> written by manufacturer, users can read not write
- 3 types: programmable read only memory PROM, erasable programmable read
only memory EPROM, electrically erasable programmable read only memory
EEPROM
Memory hierarchy:
Cache memory: speed faster than main memory but slower than registers, located between
CPU/GPU and main memory, bridge gap of high clock speed and low access time of memory
Chapter 6
TCP/IP model OSI model
IP address (IPv4)
Internet protocol or IP address is a numerical label assigned to each device connected to a
computer network that communicates through use of internet protocol
Each device owns one IP address
IPv4 Consists of 4 bytes(32 bits), maximum number of internet addresses is 2^32
Notation used is dotted decimal notation
Devices in networks
Connecting devices can be divided into four types based on functionality
Repeaters and bridges are devices connect diff LANs
Router and gateways devices different WAN and MAN
1. Repeaters
Forward physical signals between two different network nodes, works at physical layer to make
a strong clean copy of signal as original signal is regenerated
Expands connecting distance, increase max number of network nodes, using diff transmission
rates between diff network segments, improves reliability and performance of LAN
2. Bridges
Works at data link layer to achieve LAN interconnection
Divide LAN into network segments, after receiving MAC data frame from LAN, opening and
validating frame, sends it to physical layer according to another LAN reassembling data frame
May not deal with data header that upper layer protocols put in
- Bridge can connect diff LANs at data link layer, even with LANs of diff data link layer
protocol, diff transmission medium and diff transmission speed
- Bridge connects the internet and transmit/receive data, gives info about storage, filter
MAC addresses, and retransmits data packets.
3. Switches
Device which amplifies internet through providing more connecting port for subject
High flexibility, performance-to-price rate, simple and easy implementation
Consists of WAN switch and LAN switch
4. Routers
Connects bigger internet like MAN or WAN
Two types of routing protocols:
- Static routing protocols
- Dynamic routing protocols
Path selection according to routing protocol, packet switching, building map of network in form
of routing table, routing data between networks, accessing control list, restrict broadcast to LAN,
etc
Works at network layer (OSI’s third layer)
5 types of router: access router, enterprise router, backbone router, terabit router, multi-homing
router
Chapter 7
Concepts of programming languages
Language designed to transmit instructions to a machine, or a computer
Assembly languages
Using mnemonic letter codes to represent each machine language instruction
Allows programmers to write in easier ways, then assembled to machine language before
execution
Processor oriented programming language
High-level languages
Improved the efficiency of programming, ex: BASIC, python, PHP, HTML, C++, Java, etc
Natural languages
Language used in everyday life
In compsci fields such as : Natural language processing, AI.
Compilation
Program that translates whole source program into machine language program
called object program, object program then linked with supporting libraries using
linker to create executable files run directly to CPU
Compile languages: C, C++, go, rust
Interpretation
Program that reads each statement of source program in sequence, analyzes it,
translates to machine code then executes it, continuing to the next line.
Script languages: Javascript, python, PHP, ruby
7.1 comp
Chapter 8
IOT, big data, and cloud computing are conjoined in the emerging infrastructure of a smart
ecosystem
Cloud computing
Cloud computing is the delivery of computing services including servers, storage, databases,
networks, softwares, analytics, and intelligence over the internet.
- Resources and services are abstracted from underlying infrastructure
- Based on service level agreements and consumers, as they pay for what they consume
- Offers visualized network resources, reliable, efficient, security, optimal resource
utilization, scalability, compatibility, elasticity, low costs, easy to use, environmental
stability
opportunity:
- Security
- Energy efficiency
- Increased storage
- Cost savings
- Remote access
- Automatic updates
- Reliability
Big data
Large and diverse datasets that are huge in volume and rapidly growing in size over time. Used
in machine learning, predictive modeling, and other advanced analytics to solve business
problems and make informed decisions.
opportunity:
- Data science explores insights from big data, allowing principles and deep correlations to
be found
- Global transformation towards better living standards
- Ex: alibaba group, alipay, taobao, wechat pay, etc
Artificial intelligence AI
Simulation of human intelligence within machines or computer systems. Including expert
systems, natural language processing, speech recognition, and machine vision
Potentials:
- Advances in medical products and food
- Automation
- Improved efficiency
- Identification of malware
- Network traffic detection