Presentation is loading. Please wait.

Presentation is loading. Please wait.

Objectives Data Representation Binary number system Binary Coded Decimal (BCD) Boolean Values Analogue & Digital data Use of ASCII code Memory addressing.

Similar presentations


Presentation on theme: "Objectives Data Representation Binary number system Binary Coded Decimal (BCD) Boolean Values Analogue & Digital data Use of ASCII code Memory addressing."— Presentation transcript:

1 Objectives Data Representation Binary number system Binary Coded Decimal (BCD) Boolean Values Analogue & Digital data Use of ASCII code Memory addressing

2 Data Representation Character coding schemes ASCII, Unicode Unicode – International 16-bit coding system which can represent 65536 different characters Binary number system Binary Coded Decimal (BCD) each decimal digit has its own 4-bit binary code Boolean values only True or False Digitised sound MIDI Bit-mapped graphics

3 Number systems Denary system ‘134’ represents one hundred, three tens and four ones. 100101 134 = 100 + 30 + 4 = 134 Binary system 128 64 32168421 1 0000110 = 128 + 4 + 2 = 134

4 Binary number system Numbers can be represented in a computer in a number of different ways, e.g. 25 in ASCII would be: 0011 0010 0011 0101 Alternatively in pure binary draw a table of powers of 2. Then find the largest power of 2<=25 (16). Subtract 16 from 25 and repeat Value 128 64 32 16 8 4 2 1 0 0 0 1 1 0 0 1 16 + 8 + 1 = 25 To translate from binary to decimal perform same process backwards Value 128 64 32 16 8 4 2 1 0 1 0 0 0 1 0 1 64 + 4 + 1 = 69

5 Binary Coded Decimal (BCD) In the BCD system each decimal represented with own 4-bit binary code. 3765 is coded as 0011 0111 0110 0101 DecimalBinaryDecimalBinary 0000050101 1000160110 2001070111 3001181000 4010091001

6 Advantages & disadvantages of BCD Advantage - ease of conversion from BCD to decimal and vice versa. E.g. when binary numbers have to be decoded for a calculator display, a number held in BCD has simply to have each bit converted into decimal. Another advantage - BCD does not “round” numbers - uses as many bits as reqd. Disadvantage - calculations with BCD numbers are more complex. E.g adding 1 and 19 0000 0001 0001 1001 0001 1010 The first digit 1, is wrong and 1010 is an invalid code Error occurs because only 10 out of 16 combinations of 4 bits used. Whenever sum greater than 9, 6 has to be added to result in order to skip over codes 0001 1010 0110 0010 0000 i.e. 20 in BCD which is correct

7 Boolean Values A Boolean variable can only have one of two values, true or false Represented by a 1 or a 0 Useful to be able to use a binary bit to show if something is true or false, e.g: – To show whether a disk drive is connected – To show if the ‘break’ key is pressed’ Single bits used in this way are called Flags

8 Analogue & Digital data Almost everything in the world can be described or represented in one of two forms: analogue or digital. Principal feature of analogue representations is that they are continuous. Digital representations consist of values measured at discrete intervals. Digital watches are digital because they go from one value to the next without displaying all intermediate values. Display a finite number of times of the day. In contrast, watches with hands are analogue, because hands move continuously around the clock face.

9 Digitised sound Sound can be input via microphone, CD or electronic keyboard with MIDI (Musical Interchange Digital Interface) Since sound waves are continuously variable or Analogue – an analogue to digital converter is needed to transform analogue input into to a digital form, i.e. a binary pattern Undesirable sounds such as scratches can be edited Sound in analogue form can be represented by wave forms – Height of wave forms sampled at regular time intervals – Height may be represented by, say, a 16-bit code which is format used for standard audio, 8-bit slightly better than normal AM radio. – More frequently samples taken – better the sound quality

10 The ASCII code Binary digit (1 or 0) known as a ‘bit’, short for BInary digiT bits generally grouped together in 8-bit bytes a byte can hold 2 8 combinations of 0s and 1s This means that, for example, 256 different characters can be represented.

11 Sample ASCII codes Charac ASCIICharac ASCIICharac ASCIICharac ASCII A1000001K1001011U1010101a1100001 B1000010L1001100V1010110b1100010 C1000011M1001101W1010111c1100011 D1000100N1001110X1011000d1100100 E1000101O1001111Y1011001e1100101 F1000110P1010000Z1011010f1100110 G1000111Q1010001[1011011g1100111 H1001000R1010010\1011100h1101000 I1001001S1010011]1011101i1101001 J1001010T1010100^1011110j1101010

12 Memory addressing The memory of a computer can be thought of as a series of boxes, each containing 8 bits (1 byte), and each with its own unique address, counting from zero upwards. Memory capacity is measured in thousand byte units Kb, Mb, Gb. These are all powers of 2 thus although often thought of as being 1000 bytes, actually 1024 bytes. 2 10 bytes = 1024 = 1Kb 2 20 bytes = 1024 x 1024 = 1Mb 2 30 bytes = 1024 x 1024 x 1024 = 1Gb


Download ppt "Objectives Data Representation Binary number system Binary Coded Decimal (BCD) Boolean Values Analogue & Digital data Use of ASCII code Memory addressing."

Similar presentations


Ads by Google