Please enable JavaScript.
Coggle requires JavaScript to display documents.
Organization and Computer memory - Coggle Diagram
Organization and Computer memory
Self study and practice
Examples and Pressure
Tutorial
Hello world
File I/O stream: read/write binary values
Can only operate on byte arrays
we must close files after execuation
using file.close()
Otherwise the OS won't work properly
Applies on character-oriented files
Convinient
File output stream doesn not directly write output
But File write does write output directly
Computer Memory
Hardware, Physically
Electronic circuits
P: Store information
Binary
1 bit: 0 or 1
Voltages
Electronic capacitator
Charged: 1 otheriwse 0
1 byte: 8 bits
Logically
Organized into tables
Address for each cell
Unique
Variable is a memory address
a = 12
a stores 1100
Each cell: 1 byte
Visiting bits directly is prohibited
Have to visit byte
32 bit oeprating system
For 32-bit computer systems, the largest memory address is 2^3 -1
Totally there are 2^32 different addresses
4 GB memory
4
(1024)
(1024) * (1024) / 8?
64 bit operating system
int x
4 bytes, 16 bits
x = 1030
21 0s followoed by 10000000110
2^10 + 2^ 2 + 2^1
21 0s because it is a 32 bit operating system
2^31 + 1
0.5 in decimmal is 0.1 in binary
0.1 cannoot be represented by binary numbers
word: nummber and instructions
Memory Allocation
Code and static code
Heap: Dynamic data
Adjacent to code and static code
Heap vs Stack
Pointer in stack; data in heap
Data ideclared using new term
local variables (stack)