CISC1004 CH 01
CISC1004 CH 01
Data Storage
Chapter 1
1
05/09/2023
• We may associate bits with numeric values, but they are really only
symbols, whose meaning depends on the application at hand.
• Specific operations
• AND,
• OR
• XOR (exclusive or)
• NOT
2
05/09/2023
Gates
• Gate: A device that computes a Boolean operation
• Can be constructed from a variety of other technologies
• Often implemented as small electronic circuits called transistors
• Provide the building blocks from which computers are constructed
3
05/09/2023
Flip-flops
• Circuits built from gates that act as fundamentals unit of computer
memory
Figure 1.4
1.1 Bits and Their Storage Setting the output of a flip-flop to 1
Figure 1.3
A simple flip-flop circuit
4
05/09/2023
10
10
5
05/09/2023
11
11
Figure 1.8
Memory cells arranged by address
12
12
6
05/09/2023
Memory Terminology
• Random Access Memory (RAM): Memory in which individual cells can
be easily accessed in any order
• Dynamic Memory (DRAM): RAM composed of volatile memory
• Synchronous DRAM (SDRAM): retrieve contents faster than DRAM
13
13
Note: As a general rule, terms such as kilo-, mega-, etc. refer to powers of two when used in the
context of computer measurements, but they refer to powers of a thousand when used in other
contexts.
14
14
7
05/09/2023
15
15
16
16
8
05/09/2023
Figure 1.10
Compact disk (CD) storage – An
optical technology example.
17
17
Flash Drives
• Flash Memory – circuits that traps electrons in tiny silicon dioxide
chambers.
• Repeated erasing slowly damages the media.
• Mass storage of choice for:
• Digital cameras
• Smartphone
• SD Cards provide GBs of storage
This Photo by Unknown Author is licensed under CC BY-SA
18
18
9
05/09/2023
19
19
Representing Text
• Each character (letter, punctuation, etc.) is assigned a unique bit
pattern.
• ASCII: Uses patterns of 7-bits to represent most symbols used in written
English text.
• ASCII is extended to an 8-bits to fit a typical byte-size memory cell.
• ISO developed a number of 8-bit extensions to ASCII, each designed to
accommodate a major language group.
• Unicode: Uses patterns up to 21-bits to represent the symbols used in
languages worldwide, 16-bits for world’s commonly used languages.
20
20
10
05/09/2023
21
22
22
11
05/09/2023
23
23
Representing Images
• Bit map techniques
• Pixel: “picture element” represents one dot
• Array of pixels is known as a raster
• RGB: Red, Green, and Blue components
• Luminance and chrominance
• Problems with scaling up images
• Vector techniques
• Represent images with geometric structures
• Scalable
• TrueType and PostScript This Photo by Unknown Author is licensed under CC BY-SA
24
24
12
05/09/2023
Representing Sound
• Sampling techniques that record actual audio
• Long-distance telephone: 8000 samples/sec
• CD sound: 44,100 samples/sec
25
25
26
26
13
05/09/2023
27
27
28
28
14
05/09/2023
29
29
30
30
15
05/09/2023
31
31
Figure 1.19
32
32
16
05/09/2023
33
33
34
34
17
05/09/2023
35
35
Excess Notation
Figure 1.22
36
36
18
05/09/2023
37
37
• Floating-point Notation:
• A popular way based on scientific notation
• Consists of a sign bit, a mantissa field, and an exponent field.
38
38
19
05/09/2023
39
39
0 1 0 1 1 0 0 1
40
40
20
05/09/2023
41
41
42
42
21
05/09/2023
Numerical Analysis
• The study of dealing with problems when computing large values that
require significant accuracy
• The order in which values are added can lead to two different results
• Adding very small values to very large values can result in errors
43
43
44
44
22
05/09/2023
45
45
Variables
• Variables: name values for later use
• Analogous to mathematic variables in algebra
• Consider the script’s version of “Hello, World”
message = 'Hello, World!'
print(message)
• Can be used to store all the types of values that Python is able to represent.
• my_integer = 5
• my_floating_point = 26.2
• my_Boolean = True
• my_string = 'characters'
• my_integer = 0xFF
46
46
23
05/09/2023
• s = 'hello' + 'world’
• t=s*4
• print(t) # Prints “helloworldhelloworldhelloworldhelloworld”
47
47
48
24
05/09/2023
Debugging
• Syntax errors
• SyntaxError: invalid syntax
• print(5 +)
• NameError: name 'pront' is not defined
• pront(5)
• Semantic errors
• Incorrect expressions like
• total_pay = 40 + extra_hours * pay_rate
• Runtime errors
• Unintentional divide by zero
49
49
50
50
25
05/09/2023
Compressing Images
• GIF: Good for cartoons
• JPEG: Good for photographs
• TIFF: Good for image archiving
51
51
52
52
26
05/09/2023
53
53
54
54
27
05/09/2023
55
55
Data Storage
Chapter 1
End
56
28