IT Basics 2 Faculty of Cybernetics Statistics and
IT Basics 2 Faculty of Cybernetics, Statistics and Economic Informatics – BUES Prof. Răzvan ZOTA, Ph. D. zota@ase. ro http: //zota. ase. ro/itb 17 -Sep-21
Information theory basics 1. Entropy (information) Information = a message which brings a new statement in a problem with some degree of uncertainty. The uncertainty is lowering as the information appears. Being the experiment X, with the probability distribution: The system of events is considered to be complete.
Shannon’s formula http: //www. math. harvard. edu/~ctm/home/text/others/shannon/entropy. pdf Claude E. Shannon have considered the following formula as a measure for uncertainty: H is called informational entropy The unity measure of the information is the bit. One bit (Binary dig. IT) is defined as the quantity of information gained by the statement of one value from two equally probable*. http: //news. mit. edu/2010/explained-shannon-0115
Coding example What does it means that a coded signal has 1, 75 bits/symbol? = we may convert the original signal in a row of 1 and 0 such that the average is 1, 75 binary digits for each symbol from he original signal. Assume that we have 4 symbols: A, B, C, D with the probabilities: PA=1/2; PB=1/4; PC=1/8; PD=1/8 -log 2 PA = 1 bit, -log 2 PB = 2 bits, -log 2 PC = 3 bits, -log 2 PD = 3 bits As the Shannon’s formula states, the uncertainty is:
Coding example (cont. ) If we use the binary representation for the symbols A, B, C, D: A = 1; B = 01; C = 000; D = 001, then ABADCAAB will be coded as: 10110010001101 (14 binary digits used for coding the 8 symbols => the average is 14/8 = 1, 75) Obs. What is happening if we use the following coding: A = 00; B = 01; C = 10; D = 11 ?
Entropy properties
Entropy properties (cont. )
Entropy properties (cont. )
Arithmetic basis of the computers http: //www. ma. utexas. edu/users/mks/326 K 04/what. html Number system = a collection of numbers together with operations, properties of the operations and a system representing these numbers. Collection of representation rules by using symbols (digits). The number of allowed symbols is the base (radix) of the number system Number systems • positional • non-positional The roman system I X C M V L D 1 10 1000 5 50 500
Arithmetic basis of the computers In the case when a smaller value is positioned after a symbol with a bigger value, the values are added.
Arithmetic basis of the computers In the case when a symbol with a smaller value is positioned before a symbol with a bigger value, the smaller value is subtracted from the other value.
Representing a number in a base w Integer representation This is the representation of integer N in base b. The digits of number N have the following property: 17 -Sep-21
Real number representation w Real number R representation: This is the representation of a real number R in base b. The digits of R have the following property: 17 -Sep-21
Base conversion w Base conversion (integer part, fractional part) w Quick conversion between numbers represented in bases that have the following relation: 17 -Sep-21
Fixed point representation n direct code (binary) n inverse code (one’s complement) n complement code (two’s complement) 17 -Sep-21
Direct code 17 -Sep-21
Inverse code 17 -Sep-21
Complementary code 17 -Sep-21
Addition/subtraction in fixed point w Addition in DC, IC and CC (Ex. 93 -27 in IC) w Subtraction in DC, IC and CC 17 -Sep-21
BCD format representation BCD (Binary Coded Decimal) Format: • Packed BCD • Unpacked BCD In packed BCD two decimal digits are represented using a byte (the LSD on 0 -3 bits and the MSD on 4 -7 bits): 96 = 10010110 7 43 0 In unpacked BCD a digit is represented using a byte in bits 0 -3, and the bits 4 -7 are containing the value Fh: 6= 11110110 7 17 -Sep-21 43 0
BCD representation for Intel Type Length Precision Value domain (decimal) Packed BCD 80 18 (decimal digits) (-1018+1) – (1018 -1) S 79 78 17 -Sep-21 x D 17 D 16 D 15 72 71 D 0 0
Addition in BCD w Addition in BCD – normally addition in binary, for each group of 4 binary digits, considering the following cases. If a and b are the two decimal digits coded in binary, the result is: n Correct, if 0000 < c <=1001 n Wrong, and we add 0110 like in the two cases: l l 17 -Sep-21 1010 <= c <=1111 – it doesn’t match to a decimal digit (addition of 0110 will determine a transport to the next level) 0000 <= c < 1001, with the appearance of the 5 th digit, 1, which represents transport for the next group of 4 binary digits
Subtraction in BCD w Subtraction in BCD – normally subtraction in binary, for each group of 4 binary digits, considering the following cases: w If a and b are the two decimal digits coded in binary, the result c = a - b is: n correct, if c > 0 n if c < 0 then we have to borrow 1 from the next group of 4 binary digits, we make the subtraction, then we subtract the correction value of 0110. 17 -Sep-21
- Slides: 23