360 likes | 509 Views
Applied Informatics. Course 04 Information Storage Concepts. assist. eng. Jánó Rajmond , PhD rajmond.jano@ael.utcluj.ro. Introduction. In the real world information is present in analog form Must be digitized in order to be stored. Analog signal. Digitized signal. Data Representation.
E N D
Course 04Information Storage Concepts assist. eng. Jánó Rajmond, PhD rajmond.jano@ael.utcluj.ro
Introduction • In the real world information is present in analog form • Must be digitized in order to be stored Analog signal Digitized signal
Data Representation • logical value (true/false) • numerical values • integers • unsigned – natural numbers • signed – whole numbers • fractional • alphanumeric – text • multimedia • audio • video • static images • sequences of frames (video) • signals – physical process measurements, acquired via sensors/transducers
Data Representation • logical value (true/false) • numerical values • integers • unsigned – natural numbers • signed – whole numbers • fractional • alphanumeric – text • multimedia • audio • video • static images • sequences of frames (video) • signals – physical process measurements, acquired via sensors/transducers
Numeral systems • A numeral system is defined by • the base of the system: b • symbols used: 0, 1, 2, … (b-1) • representation: Xb = xn…x2x1x0.x-1x-2…xm • calculation of the value: X= xn.bn+...+x2.b2+x1.b1+x0.b0 +x-1.b-1 + x-2.b-2 + ...+ xm.b-m
Numeral systems Numeral systems used in IT: • binary b = 2, s = [0, 1] • decimal b = 10, s = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] • hexadecimal b = 16, s = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F]
Decimal to Binary Conversion • Integer part • divide successively with the base (b) and retain the modulo of the division until 0 is reached • read the moduli in inverse order for final result 35(10) = 100011(2)
Decimal to Binary Conversion • Fractional part • multiply successively the factional part with the base (b) and retain the integer part • read the retained integers in the obtained order 0.35(10) = 0.010110…(2) What is 35.35(10) in binary? 100011.010110
Decimal to Binary Conversion Convert to binary the following: • 3.14(10) • 10.10(10) • 23.45(10) 11.00100(2) 1010.00011(2) 10111.01110(2)
Binary to Decimal Conversion MSB LSB • X(10) = xn.2n+...+x2.22+x1.21+x0.20 +x-1.2-1 + x-2.2-2 + x-3.2-3 +... X(10) = 1.25+1.24+0.23+1.22+1.21+0.20+0.2-1+1.2-2+0.2-3+1.2-4+0.2-5+0.2-6 = 32 + 16 + 0 + 4 + 2 + 0 + 0 +0.25+ 0+0.0625+ 0+ 0 = 54.3125
Binary to Decimal Conversion Convert to decimal the following values • 1010(2) • 1101.0101(2) 10(10) 13.3125(10)
Hexadecimal System • used to shorten the binary information 1 byte = 8 bits 1 nibble = 4 bits 1 nibble = 4 bits
Hexadecimal System 1 nibble = 4 bits
Binary to Hexadecimal Conversion D 6 11010110(2) = D6(16) D6(16) = D6h = 0xD6 Binary Coded Decimal (BCD)
Hexadecimal to Binary Conversion • To opposite operation to binary to hexa conversion • Needs the exact same steps reversed 5 A 0101 1010 0x5A = 01011010b = 90
Exercise A microcontroller is connected via 8 digital lines to two BCD coded seven segment displays. • What information should the microcontroller transmit to the displays in order to show: 45, 7A, bC? • What information will the displays show of they receive: 1000 1111, 0011 1001? • What decimal values correspond to the above hexadecimal values?
Exercise 0100 0101 0111 1010 1011 1100
Exercise 1000 1111 0011 1001
Exercise What is the highest number that can be represented on 8 bits? 1111 1111b = 0xFF = 255
Data Representation • logical value (true/false) • numerical values • integers • unsigned – natural numbers • signed – whole numbers • fractional • alphanumeric – text • multimedia • audio • video • static images • sequences of frames (video) • signals – physical process measurements, acquired via sensors/transducers
Data Representation • logical value (true/false) • numerical values • integers • unsigned – natural numbers • signed – whole numbers • fractional • alphanumeric – text • multimedia • audio • video • static images • sequences of frames (video) • signals – physical process measurements, acquired via sensors/transducers
Alphanumeric Codes • used to code alphanumeric characters and simple graphics that can be stored at the size of a single character • widest used standard is the ASCII (American Standard Code for Information Interchange) standard (1 byte – max. 255 characters) • the Unicode standard extends ASCII by adding an extra byte (2 bytes – max. 65536 characters)
Exercise The following message is stored in a computer’s RAM memory, coded in hexa ASCII. Decode the message!
Exercise Code the following message using the ASCII standard!
Data Representation • logical value (true/false) • numerical values • integers • unsigned – natural numbers • signed – whole numbers • fractional • alphanumeric – text • multimedia • audio • video • static images • sequences of frames (video) • signals – physical process measurements, acquired via sensors/transducers
Data Representation • logical value (true/false) • numerical values • integers • unsigned – natural numbers • signed – whole numbers • fractional • alphanumeric – text • multimedia • audio • video • static images • sequences of frames (video) • signals – physical process measurements, acquired via sensors/transducers
Multimedia • combination of text, audio, images, animations, video and other forms of interactive content • it usually needs special decoding processes which are aware of the coding methods used specialized software specialized hardware CODEC
Signals • acquired via data acquisition systems
Courses Available online at: http://www.ael.utcluj.ro/ Information for Students -> Courses -> Applied Informatics