L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................vbhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................vbhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh

Download L1- Number Systems jhkj njn bhagavad gita ...............................          hgjbhbjhbjhbjhjbbjbkj jhj hbjh                                  .........................................................bhagavad gita ...............................          hgjbhbjhbjhbjhjbbjbkj jhj hbjh                                  .........................................................bhagavad gita ...............................          hgjbhbjhbjhbjhjbbjbkj jhj hbjh                                  .........................................................vbhagavad gita ...............................          hgjbhbjhbjhbjhjbbjbkj jhj hbjh                                  .........................................................bhagavad gita ...............................          hgjbhbjhbjhbjhjbbjbkj jhj hbjh                                  .........................................................vbhagavad gita ...............................          hgjbhbjhbjhbjhjbbjbkj jhj hbjh

Post on 04-Jun-2018

216 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

<ul><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 1/32</p><p>Microprocessors &amp; Interfacing</p><p>XX F241</p><p>Number systemsKCS Murt i</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 2/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Structure</p><p> Number systems</p><p> Decimal</p><p> Binary</p><p> Hexa Decimal</p><p> Operations</p><p> BCD Codes</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 3/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Number Systems</p><p> Decimal (0,1,2,3,4,5,6,7,8,9) Octal (0,1,2,3,4,5,6,7)</p><p> Hexadecimal (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)</p><p> Binary (0,1)</p><p>A number anan-1a2a1a0a-1a-m expressed in base-rsystem, has coefficients multiplied by powers of r </p><p>an.rn+an-1.r</p><p>n-1+.+a2.r2+a1.r</p><p>1+a0.r0+a-1.r</p><p>-1+a-</p><p>2.r-2+a-m.r-</p><p>m</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 4/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Convert to decimal</p><p>(B65F)16= 11X 163 + 6X 162 +5X 161 +15= (46687)10</p><p>(4021.2)5=4X 53+0 X 52+ 2X 51 +1 X 50 +2 X 51 = (511.4)10</p><p>(1010.011)2= 23 + 21+ 2-2+ 2-3= (10.375)10</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 5/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Binary Octal and Hexadecimal</p><p>(10 1100 0110 1011 . 1111 0010 )2= (2C6B.F2)16</p><p>(10 110 001 101 011 . 111 100 000 110)2= (26153.7460)8</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 6/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Repeated division steps: Divide the decimal number by 2</p><p> Write the remainder after eachdivision until a quotient of zero is</p><p>obtained. The first remainder is the LSB</p><p>and the last is the MSB</p><p>Decimal to Binary</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 7/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Decimal to binary..</p><p>10</p><p>Convert (153)10to Octal</p><p>0</p><p>5 0</p><p>41</p><p>20 1</p><p>1 0</p><p>2 1</p><p>Ans=101001</p><p>Integer ReminderConvert (41)10to binary</p><p>2 3</p><p>0 2</p><p>153</p><p>19 1</p><p>Ans=(231)8</p><p>0 1</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 8/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Decimal to hexadecimal</p><p>0 E</p><p>227</p><p>14 3</p><p>Ans=0xE3H</p><p>Integer ReminderConvert (227)10toHexadecimal</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 9/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Decimal fractions to octal</p><p>0.513 X 8= 4.104</p><p>0.104 X 8= 0.832</p><p>0.832 X 8= 6.656</p><p>0.656 X 8= 5.2480.248 X 8= 1.984</p><p>0.984 X 8= 7.872</p><p>(0.513)10= (0.406517..)8</p><p>Convert (0.513)10to octal</p><p>4 0 6 5 1 7</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 10/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Two types namely radix and diminished radix complement Diminished Radix or (r-1)s complement : For a number N</p><p>with n digits,</p><p>it is defined as (rn-1)-N</p><p> Radix or rscomplement : For a number N with n digits, it</p><p>is defined as</p><p>(rn-1)-N+1</p><p>Complements</p><p>9s complement of 546700 is (999999-546700)=453299</p><p>9s complement of 012398 is (999999-012398)=987601</p><p>10s complement of 012398 is 987602</p><p>10s complement of 246700 is 753300</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 11/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>1s and 2s complement</p><p>1s complement of 1011000 is</p><p>2s complement of 1101011 is</p><p>0100111</p><p>10100101s complement of 0101101 is</p><p>0010101</p><p>2s complement of 0110111 is 1001001</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 12/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Signed Binary Numbers</p><p>Signed magnitude of +7 00000111</p><p>Signed magnitude of -7 10000111</p><p>Represent +7 in 2s complement form</p><p>Place 0 in sign bit 0</p><p>Place magnitude in remaining 7 bits 00000111</p><p>Represent -7 in 2s complement form</p><p>Start with 8 bit code for +7 00000111</p><p>Invert each bit including the MSB 11111000</p><p>Add 1 11111001</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 13/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Signed binary numbers</p><p>Get the magnitude of -7</p><p>Its 2s complement is 11111001</p><p>MSB is 1. So magnitude is in 2s</p><p>complement.Invert all bits including sign. 00000110</p><p>Add 1 00000111</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 14/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Range of numbers in 2s complement</p><p>Signed binary Decimal</p><p>01111111 +127</p><p>------</p><p>00000001 +100000000 Zero</p><p>11111111 -1</p><p>-------</p><p>10000001 -127</p><p>10000000 -128</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 15/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Addition</p><p>+13 00001101</p><p>+9 00001001</p><p>+22 00100110</p><p>+13 00001101</p><p>-9 11110111</p><p>+4 000001001</p><p>Ignore carry</p><p>+9 00001001</p><p>-13 11110011</p><p>-4 11111100</p><p>-9 11110111</p><p>-13 11110011</p><p>-22 11101010</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 16/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Hexa decimal addition</p><p>7A 0111</p><p>3F</p><p>1010</p><p>0011 1111</p><p>B9 1011 1001</p><p>7 A</p><p>3 F</p><p>1110 2510</p><p>B16 916</p><p>1 Carry</p><p>B16 916</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 17/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Overflow</p><p>01110011</p><p>11010001</p><p>01000100</p><p>115 115</p><p>209 -47</p><p>68 68</p><p>Interpreted as</p><p>unsigned binary</p><p>(Incorrect)</p><p>Interpreted as</p><p>2s complement</p><p>(correct)</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 18/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p> Each decimal digit is represented using 4 bits. Ex: convert 87410to BCD:</p><p>8 7 4</p><p>0100 0111 0100 = 010001110100BCD</p><p> Reverse the process to convert BCD to decimal</p><p>BCD code</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 19/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Advantages</p><p>1. Ease of conversion</p><p>2. Easy to design the logic circuit.</p><p>3. Only the 4 bit groups for the decimal digits 0 to 9 need to</p><p>be remembered.</p><p>Disadvantages:</p><p>1. BCD requires more bits</p><p>BCD code..</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 20/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Other binary codes</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 21/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Binary Gray Code000 000001 001010 011011 010100 110101 111110 101111 100</p><p>Grey code</p><p>Only one bit changes between successive values</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 22/32</p><p>XX F241 MicroprocessorsKCS Murti</p><p>Gn = BnGn-1= Bn Bn-1</p><p>Gn-2 = Bn-1 Bn-2</p><p>..</p><p>..</p><p>G1 = B2 B1</p><p>Binary to Grey code conversion</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 23/32</p><p>Binary 1 0 0 1</p><p>Gray 1 1 0 1</p><p>Gray to Binary</p><p>Gray 1 1 0 1</p><p>Binary 1 0 0 1</p><p>Example</p><p>Binary to Gray</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 24/32</p><p>XX F241 Microprocessors</p><p>KCS Murti</p><p>Grey codes</p><p>Angular position Measurement where eachsegment is assigned a binary number</p><p>Drive</p><p>Load</p><p>Shaft</p><p>encoder</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 25/32</p><p>XX F241 Microprocessors</p><p>KCS Murti</p><p>Shaft encoder</p><p>Shaft Encoder</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 26/32</p><p>Bytes : A byte is a string of eight bits.</p><p>Nibble: A nibble is a string of four bits.</p><p>Word : The word size can be defined as the</p><p>number of bits in the binary word that a</p><p>digital system operates on.</p><p>i.e., it depends on the data pathway ofthe system.</p><p>The byte, Nibble and Word</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 27/32</p><p>XX F241 Microprocessors</p><p>KCS Murti</p><p> ASCII American Standard Code forInformation Interchange</p><p> A binary code for letters, numerals, specialcharacters and control characters.</p><p> Seven bit code: 27= 128 possible codegroups</p><p> 94 Graphic Characters and 34 non printing</p><p>control characters</p><p>Alphanumeric Code</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 28/32</p><p>XX F241 Microprocessors</p><p>KCS Murti</p><p>Alphanumeric Code</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 29/32</p><p>Parity:</p><p>An extra bit (parity bit) is added to each word</p><p>being transmitted.</p><p>Even parity: P = 0 or 1 at Tx, such that no . of 1s</p><p>in the code including parity bit is an</p><p>evennumber.</p><p>Odd Parity: P= 0 or 1 , such that no. 1s in thecode includingparity bit is an odd</p><p>number.</p><p>Error detection codes</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 30/32</p><p>Let the code group is 1000001 (ASCII code forA),if evenparity is used, P=0.</p><p>so, the new code 10000010</p><p>ifodd parityis used, P=1</p><p>so, the new code 10000011</p><p>Where the last bit in the new code is parity bit (P)</p><p>Example</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 31/32</p><p>1. Position of error cannot be detected.2. Parity method would not work if two bits</p><p>were in error.</p><p>Limitations:</p></li><li><p>8/13/2019 L1- Number Systems jhkj njn bhagavad gita ............................... hgjbhbjhbjhbjhjbbjbkj jhj hbjh .........................................................bhagavad gita ...........................</p><p> 32/32</p><p>XX F241 MicroprocessorsKCS Murti</p></li></ul>