Computer-Based Instrumentation 11/12/01 ISAT 300.

25
Computer-Based Instrumentation 11/12/01 ISAT 300

Transcript of Computer-Based Instrumentation 11/12/01 ISAT 300.

Computer-Based Instrumentation

11/12/01

ISAT 300

The generalized measurement system – Figure 2.1

Sensingelement

Signalmodificationsubsystem

Indicator orrecorder

Measurand

ComputerE.g., for temperature measurement, could be a thermocouple or a thermistor

Computer-Based Instrumentation

ConnectionModule

Computer

Thermocouple or thermistor

Computer-Based Instrumentation

Computer-Based Instrumentation

Measurand

Sensingelement

Signalmodificationsubsystem

Indicator orrecorder

Computerized Data Acquisition System – Fig. 4.1

What we want to know about

What’s a MUX? (Multiplexer) – Fig. 4.4

• What if we want to monitor several measurands? (several temperatures, pressure, humidity, illumination,etc.)

We need to monitor several sensors.

• In most cases, each sensor is connected to a separate channel of the computerized data acquisition system.

• The computer reads information from the various channels one at a time using a device called a multiplexer (MUX).

• The MUX is an electronic switch.

What’s a MUX? (Multiplexer) – Fig. 4.4

• The computer instructs the MUX to select a particular channel and the data are then read and processed.

• The computer then instructs the MUX to select a another channel …

Computerized Data Acquisition System – Fig. 4.1

What we want to know about

Computerized Data Acquisition

• Information in computers is stored in bistable devices, called “flip-flops”.

• Flip-flops can have two possible states.• The “on” state is assigned a numerical value of

1.• The “off” state is assigned a numerical value of

0.• We need to know a little bit about binary.• The analog-to-digital converter converts an

analog signal (generally a voltage) to a digital (binary) code.

Everything I need to know I learned in kindergarten

“Sing a song of sixpence, a pocket full of rye,Four and twenty blackbirds baked in a pie”

24

2 tens + 4 ones

01 104102

Another example (decimal system)

0123 104102102101

1224

10 digits = 10 possibilities

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

Binary system

11

1208

11214081

21212021 0123

1011

2 digits = 2 possibilities

0, 1

Binary numbers--what’s it worth?

1 0 1 0 1 0 1 0128 64 32 16 8 4 2 1

0000 1111 b = 15 d 1111 1111 b = 255 d

0000 1111 1111 1111 b = 4095 d

1111 1111 1111 1111 b = 65,535 d8 bits = 1 byte

Examples: converting binary to decimal

0000 0101 b = ? d

0000 1111 b = ? d

0010 1010 b = ? d

1101 0101 b = ? d

Adding in binary

0 0 1 1+0 +1 +0 +1

0 1 1 10

Subtracting in binary

1 1 11 100 1 1 1

1 0 10 1

3 +3

6

More adding in binary

11 +11

110

compareto decimal:

Converting decimal to binary

1 R 021

0 R 122

1 R 225

1 R 5211

1 R 11223

0 R 23246

0 R 46292

least significant bit (lsb)

most significant bit (msb)

“zero padding”

92 d = 0101 1100 b

Examples: converting decimal to binary

12 d = ? b

75 d = ? b

1215 d = ? b

Representing negative numbers – 2’s complement

0000000100100011010001010110011110001001101010111100110111101111

0123456789101112131415

01234567-8-7-6-5-4-3-2-1

4 bits ofnumbers

3 bits ofnumbers,

1 bit ofsign

2’s complement--hard for us, easy for the computer

1) Convert the magnitude of the number to binary-- have at least one “leading zero”

2) Invert all of the bits--0’s become 1’s, 0’s become 1’s

3) Add 1 to the result

To get positive numbers:

1) Convert the magnitude to binary--but you must have at least one “leading zero”

To get negative numbers:

1) Convert the magnitude of the number to binary-- have at least one “leading zero”

2) Leave it alone--it’s positive!

2’s complement--hard for us, easy for the computer

Example: +92

01011100

1) Convert the magnitude of the number to binary-- have at least one “leading zero”

2) Invert all of the bits--0’s become 1’s, 0’s become 1’s

3) Add 1 to the result

2’s complement--hard for us, easy for the computer

Example: - 92

01011100

10100011

10100011 +110100100

2’s complement--example

+19 d = ? b -19 d = ? b

Use one byte = 8 bits for both