Top Banner
Pertemuan 1 Teknik Digital 1 zulhelman PNJ [email protected] http://zulhelman64.wordpress.com/digital- electronic/
26

Pertemuan1dan 2 Tek Digital 1

Sep 28, 2015

Download

Documents

hannajaidi

knkn
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • Pertemuan 1 Teknik Digital [email protected]

    http://zulhelman64.wordpress.com/digital-electronic/

  • Elektronika Digital Number Systems and LogicGerbang LogikaRangkaian Logika KombinasionalRangkaian SequensialRangkaian ADC DACMemory

  • Materi :Data Digital vs Data AnalogInput dan Output BinarySistem Bilangan Binary, octal, decimal and hexadecimal.Pengkodean Biner

  • Sistem AnalogV(t) can have any value between its minimum and maximum value V(t)

  • Sistem Digital V(t) must take a value selected from a set of values called an alphabetBinary digital systems form the basis of almost all hardware systems currently V(t)For example, Binary Alphabet: 0, 1. 10101

  • AnalogiConsider a childs slide in a playground:continuous movementa set of discrete stepslevels

  • Hubungan Antara sistem Analog dan sistem DigitalKeuntungan Sistem DigitalAnalogue systems: eror yang kecil di input menghasilkan error yang besar di outputSistem Digital lebih akurat dan reliableComputers use digital circuits internallyInterface circuits (for instance, sensors and actuators) are often analogue

  • Input dan Output BinerCoding:A single binary input can only have two values: True or False (Yes or No) (1 or 0)

  • BinaryMore bits = more combinations 0 0 0 1 1 0 1 1 Each additional input doubles the number of combinations we can represent i.e. with n inputs it is possible to represent 2n combinations

  • Combinations

    Example 1:How many combinations are possible with 10 binary inputs?

    Example 2:What is the minimum number of bits needed to represent the digits 0 to 9 as a binary code?

  • Decimal systemsNumber RepresentationDifficult to represent Decimal numbers directly in a digital systemEasier to convert them to binaryThere is a weighting system:

    eg 403 = 4 x 100 + 0 x 10 + 3 x 1

    or in, powers of 10:

    40310= 4x102 + 0x101 + 3x100 = 400 + 0 + 3

  • Binary Inputs and OutputsBoth Decimal and Binary numbers use a positional weighting system, eg: 10102 = 1x23+0x22+1x21+0x20 = 1x8 + 0x4 + 1x2 + 0x1 = 1010

    decimal100 (102)10 (101)1 (100)403400 + 0 + 3

    binary8 (23)4 (22)2 (21)1 (20)10018 + 0 + 0 + 1

  • Binary to decimalMultiply each 1 bit by the appropriate power of 2 and add them together.100000112 = .10 ?

    1010011002 = 10 ?

    ??128643216842110000011101001100

  • Binary Inputs and OutputsNumber Representation - Binary to decimalA decimal number can be converted to binary by repeated division by 2

    15510 = 100110112

    number/2remainder155771Least Significant Bit77381381901991941420210101Most Significant bit

  • Decimal to BinaryAn alternative way is to use the placement method

    128 goes into 155 once leaving 27 to be placed

    So 64 and 32 are too big (make them zero)16 goes in once leaving 11

    and so on

    1286432168421

    1

    1001

  • RepresentationsThere are different ways of representing decimal numbers in a binary coding

    BCD or Binary Coded Decimal is one example.

    Each decimal digit is replaced by 4 binary digits

  • Binary Inputs and Outputs6 of the possible 16 values unused

    example 45310 = 0100 0101 0011BCD

    Note that BCD code is longer than a direct representation in natural binary code:

    453 = 111000101

  • Binary Inputs and OutputsHexadecimal and OctalWriting binary numbers as strings of 1s and 0s can be very tediousOctal (base 8) and Hexadecimal (base 16) notations can be used to reduce a long string of binary digits.

    Notice that hexadecimal requires 15 symbols (each number system needs 0 base-1 symbols) and therefore A F are used after 9.

    octal512 (83)64 (82)8 (81)1 (80)1207512 + 128 + 7

    hexadecimal256 (162)16 (161)1 (160)1AF256 + 160 + 15

  • Octal as shorthand for BinaryEach octal digit corresponds to 3 binary bitsTo convert a binary string: 10011101010011

    Split into groups of 3: 010 011 101 010 011 2 3 5 2 3

    Thus 100111010100112 = 235238

    binaryoctal00000011010201131004101511061117

  • Similarly with HexadecimalEach hex digit corresponds to 4 binary bitsTo convert a binary string: 10011101010011

    Split into groups of 4: 0010 0111 0101 0011

    Thus 100111010100112 = 16 ?

    binaryhex0000000011001020011301004010150110601117

    binaryhex10008100191010A1011B1100C1101D1110E1111F

  • Binary inputs and outputsColour codes

    You often see hex used in graphic design programs for the red, blue and green components of a colour:

    FF0000 represents red, for example.

    How many bits are used to represent each colour?

    How many different colours can be represented?

  • Binary Inputs and OutputsCharactersThree main coding schemes used: ASCII (widespread use), EBCDIC (not used often) and UNICODE (new)ASCII table (in hex) :

  • Gray Codes Other codes exist for specific purposesGray codes provide a sequence where only one bit changes for each incrementAllows increments without ambiguity due to bits changing at different times.E.g. changing from 3 to 4, normal binary has all three bits changing 011 -> 100. Depending on the order in which the bits change any intermediate value may be created.

    DecGray 00001001201130104110511161017100

  • Konversi Biner ke kode Grey : Caranya adalah dengan menambahkan angka paling depan ke belakang. contoh 1 : konversikan 0010(2) =............(Grey code) catatan : 0 0 0 exor 0 = 0 0 exor 1 = 1 1 Exor 0 = 1 angka ke-empat hasil konversi 0010(2) = 0011(Grey code)

    contoh 2 : konversikan 1111(2) =.1000 (Grey code)

  • Konversi Grey code ke Biner : caranya dengan menambahkan angka paling depan ke belakang, setelah mendapat hasilnya ditambahkan ke belakang lagi. contoh 1 : konversikan 1000(Grey code) =............(2) 1 exor 0 = 11 exor 0 = 11 exor 0 = 11 exor 0 = 1 hasil konversi 1000(Grey code) = 1111(2) contoh 2 : konversikan 0011(Grey code) =.0010.............(2) hasil konversi 0011(Gray code) = 0010(2)

  • ExercisesYou should practice conversions between binary, octal, decimal and hexadecimal.

    You should be able to code decimal to BCD (and BCD to decimal) and between binary to gray.

    You should be able to explain and give examples of digital and analogue data.

    **A volume control on a stereo requires more than two positions (off and full volume)2 inputs can represent 4 values 3 inputs can represent 8 values 4 inputs can represent 16 values 5 inputs can represent 32 values ...Example 1 There would be 210 = 1024 = 1K combinationsExample 2 Need to represent 10 digits Using three bits only allows us to represent 8 and 4 bits allows us to represent 16 - have to use 4 inputs.****Octal group into lots of 3 binary digits starting from the LSBHex group into lots of 4 binary digits starting from the LSB*