02. pertemuan 2

Upload: wan-blenk-baenk

Post on 05-Apr-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 02. Pertemuan 2

    1/26

    2.1 Binary Coded Decimal2.1.1 BCD-to-Binary Conversion

    2.1.2 Binary-to-BCD Conversion

    2.1.3 Higher-Density BCD Encoding

    2.1.4 Packed and Unpacked BCD Numbers

  • 8/2/2019 02. Pertemuan 2

    2/26

    Sistem Bilangan yang kita kenal saat iniadalah sistem angka desimal, yaitu bilangandengan bilangan dasar 10

    Dalam setiap sistem bilangan senantiasamempunyai :

    Bilangan dasar angka maksimum

    Angka Absolut Jenis Lambang bilangan yang bernilaiberbedabeda (0,1,2,3,4,5,6,7,8,9)

    Nilai Letak.

    nilai yang tergantung pada posisi yaituperpangkatan dari bilangan dasarnya.

  • 8/2/2019 02. Pertemuan 2

    3/26

  • 8/2/2019 02. Pertemuan 2

    4/26

    Nama BilanganDasar Lambang Bilangan Yang muncul

    Binary 2 0,1Ternary 3 0,1,2

    Quarterrary 4 0,1,2,3

    Quinary 5 0,1,2,3,4

    Senary 6 0,1,2,3,4,5

    Septenary 7 0,1,2,3,4,5,6

    Octal 8 0,1,2,3,4,5,6,7

    Novonary 9 0,1,2,3,4,5,6,7,8

    Decimal 10 0,1,2,3,4,5,6,7,8,9

    Uni decimal 11 0,1,2,3,4,5,6,7,8,9,ADuo decimal 12 0,1,2,3,4,5,6,7,8,9,A,B

    Terdenary 13 0,1,2,3,4,5,6,7,8,9,A,B,C

    Quarterdenary 14 0,1,2,3,4,5,6,7,8,9,A,B,C,D

    Quidenary 15 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E

    Hexa decimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

  • 8/2/2019 02. Pertemuan 2

    5/26

    The binary coded decimal (BCD) is a type of binarycode used to represent a given decimal numberin an equivalent binary form.

    As an example, the BCD equivalent of (23.15)10

    is written as (0010 0011.0001 0101)BCD

    2.1.1 BCD-to-Binary Conversion

  • 8/2/2019 02. Pertemuan 2

    6/26

  • 8/2/2019 02. Pertemuan 2

    7/26

    3/2=1 1

    =0 0

  • 8/2/2019 02. Pertemuan 2

    8/26

    8/2=4 0

    4/2=2 02/2=1 0

  • 8/2/2019 02. Pertemuan 2

    9/26

  • 8/2/2019 02. Pertemuan 2

    10/26

    A given BCD number can be converted into anequivalent binary number by first writing its decimalequivalent and then converting it into its binaryequivalent.

  • 8/2/2019 02. Pertemuan 2

    11/26

    BCD

    8421 BCD

    5 = 0101

    2 = 0010

    4 = 0100

    Binary dari 524524/2=262 0

    262/2=131 0

    131/2=65

    165/2=32 1

    32/2=16 0

    16/2=8 0

    8/2-4 04/2=2 0

    2/2=1 0

  • 8/2/2019 02. Pertemuan 2

    12/26

    A given binary number can be converted into anequivalent BCD number by first determining itsdecimal equivalent and then writing the correspondingBCD equivalent.

  • 8/2/2019 02. Pertemuan 2

    13/26

    1x23+0x22+0x21+0x20

    8+ 0 + 0 + 0 (8)10

  • 8/2/2019 02. Pertemuan 2

    14/26

    In the regular BCD encoding of decimal numbers, thenumber of bits needed to represent a given decimal numberis always greater than the number of bits required forstraight binary encoding of the same. For example, a three-digit decimal number requires 12 bits for representation inconventional BCD format. However, since 210 > 103, ifthese three decimal digits are encoded together, only 10bits would be needed to do that. Two such encodingschemes are Chen-Ho encoding and the densely packeddecimal. The latter has the advantage that subsets of theencoding encode two digits in the optimal seven bits andone digit in four bits like regular BCD.

  • 8/2/2019 02. Pertemuan 2

    15/26

    In the case of packed BCD numbers, two BCD digits arestored in a single eight-bit register. Theprocess of combining two BCD digits so that they are stored

    in one eight-bit register involves shiftingthe number in the upper register to the left 4 times and thenadding the numbers in the upper and lowerregisters..

  • 8/2/2019 02. Pertemuan 2

    16/26

    How many bits would be required to encode decimal

    numbers 0 to 9999 in straight binary and BCD codes?What would be the BCD equivalent of decimal 27 in 16-bit representation?

    Solution

  • 8/2/2019 02. Pertemuan 2

    17/26

  • 8/2/2019 02. Pertemuan 2

    18/26

  • 8/2/2019 02. Pertemuan 2

    19/26

  • 8/2/2019 02. Pertemuan 2

    20/26

  • 8/2/2019 02. Pertemuan 2

    21/26

  • 8/2/2019 02. Pertemuan 2

    22/26

  • 8/2/2019 02. Pertemuan 2

    23/26

  • 8/2/2019 02. Pertemuan 2

    24/26

  • 8/2/2019 02. Pertemuan 2

    25/26

    sampai jumpaminggu depan

  • 8/2/2019 02. Pertemuan 2

    26/26