Electronics Lab Manual

Volume 2

M Tech Asst.Professor, ECE Dept. College of Engineering Trivandrum Thiruvananthapuram-695016 kanavas@rediffmail.com

K. A. NAVAS,

Rajath Publishers
28/450-A, Club Road, Girinagar South, Kadavanthra, Kochi-682020

com Price Rs. or otherwise circulated without publisher’s prior written consent in any form of binding or cover other than that in which it is published and without a similar condition including this condition being imposed on the subsequent purchaser and without limiting the rights under copyright reserved above. Girinagar South Kadavanthra. 180. Club Road.Electronics Lab Manual Volume 2 Fourth edition Copyright c 2009 Rajath publishers and the author jointly This book is sold subjected to the condition that it shall not. hired out. resold. Published by Rajath Publishers 28/450-A.00 A Type set in LTEX Printed at Pioneer offset. recording or otherwise). photocopying. Kochi-15 . Ravipuram. be lent. mechanical. no part of this publication may be reproduced. without prior permission of the copyright owner. by way of trade or otherwise. or transmitted in any form or by any means (electronic. Kochi-682020 Phone:0484-2313911 e-mail:rajathpbs@yahoo. stored in or introduced into a retrieval system.

. . . . . . . . . . . . . . .2 Measurements of op-amp parameters . . . . . . . . . .6 Monostable multivibrator . . . . . .12 Wien bridge oscillator . . . . 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1. . . . . . . . 1. 1. . 1. .15 Window detector using comparator IC 311 . . . . . . . . . . . . . . .9 Triangular wave generator . . . . . . . . . . . . . . . . . . . . .24 High voltage regulator using 723 IC . . . . . . . . . . . . . . 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 Counter ramp ADC . . . . . . . . . . . . . . . . . 1.11 RC phase shift oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 Low voltage regulator using 723 IC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 Peak detector . .14 Window detector using op-amp .21 Filter using gyrator circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1. . . 1. . . . . . . . . . . . 1. . . . . . . 1. 1. . . . . . . . . . . . . .10 Sawtooth wave generator using op-amp . . . . . . . . . . . . . . . . . . . . . . . . . 1. . . . . . . . . . .1 Familiarisation of op-amp . . . . . . . . . . . . . . . . . . . . . . . . . . .20 Clamping circuits . . . . . . . . . . . . . . . . . . . . . . . .8 Full wave rectifier using op-amp . . . . . 5 11 11 12 15 25 28 31 33 34 34 37 38 39 40 41 42 43 44 45 47 50 52 54 55 58 61 63 64 65 . . . . . . . . . . .4 Schmitt trigger . . . . . . . . . 1. 1. . . .25 LVR with current foldback . . . 1. 1. . . . . . . . . . . . .17 Instrumentation amplifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.7 Half wave rectifier using op-amp . . . . . . 1. . . . . . . . . . . .27 Study of ADC and DAC ICs . .5 Astable multivibrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Basic operational amplifier circuits . . . . . . . . . . . . . . . . . .22 Three terminal voltage regulators . .13 Wien bridge oscillator with amplitude stabilisation 1. . . . . . . . . . . 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1. . 1. . . 1. . . . . . . . . .Contents 1 Linear/Analog IC Lab 1. . . .18 Voltage limiters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1. . . . . . . .28 Study of waveform generator IC 8038 . 1. . . . . . . . . . .19 Clipping circuits . . . . . . . . . . . . . . . . . . . . . . 1. .

. . . . . . . . . . . . . . . . . . . . . . . . . . 2. . . . . . . . . . . . . . . . . . . . 2. . . . . . . . . . . .32 Second order high pass filter . . . . . . . . . . . . . . . 2. . . . . . . . .10 Study of 565 PLL . . . .30 Examination questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. . . . . . . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 First order high pass filter . . . . . . . . . . . . . 67 1. . . . . . . . . . . . . . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. 2. . . . .29 First order low pass filter . . . . . . . . . . . . . . . . . . . . . . . . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 m-derived LPF and HPF . . . . . . . . . . . . . . . . . . . . . . . . . 2. . . . . . . . .17 PWM using 555 . . . . . . . . . . . . . . . . . 70 70 74 77 83 85 86 88 91 94 96 99 100 102 104 105 106 109 110 112 113 115 117 119 121 123 126 127 131 133 135 136 138 139 141 142 143 . . . . . . . . . . . .4 AM using multiplier IC AD534/AD633 . . . . . . . . . . . . . . 2. . . . . . . . . 2. . . . . . . . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. . . . . . .14 FM generation and demodulation using 4046 . . . . . . . . .26 Pre-emphasis de-emphasis . . . . . . . . . . . . . . . . . . . . . . . .29 Sawtooth generator using 555 . . . . . . . . . . . . . . . . . . . . . . 2. . . . .28 Pseudo-random binary sequence generator . . . . . . . . . . . . .9 FM using 555 IC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 PWM using op-amp . . . . . . . . . . . . . . . . . . . . . 68 2 Analog and Digital Communication Engineering Lab 2. . . . . . . . . . . . . . . . . . . 2. . . . . . . . . . . . . . . . . . . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 PPM using 555 . . . . . . . . . .6 Mixer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. .27 Error checking and correcting codes . . . . . . . .25 BFSK . . . . . . 2. . . . .12 Frequency multiplier using 565 . . . . . . .8 FM using 566 IC . . . . . . . . . .3 AM generation .16 PAM modulator and demodulator . . 2.15 Frequency multiplier using 4046 . . . . . .36 All pass filters . . . . . . . . . . . . . . . . . . .30 Second order low pass filter . . . 2. . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 PCM . . . 2. . . . 2. .23 BASK . . . . . . . . . . . . . .6 Electronics Lab Manual Volume 2 1.1 Constant-k LPF and HPF . . . . . . . . . . . . . . 2. . . . . . . . . . . .11 FM generation and demodulation using 565 . . . . . . . . . . . . . . . . . . . . . 2. . . 2. . . . . . . . . . . . . . . . 2. . . 2. . . 2. . . . . . . 2. . . 2. . . . . . . . . . . . . . .34 Notch filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.33 Band pass filter . . . . . . . . . . . . . . . . . . . .35 Universal active filter . . . . . . . . . . .7 IF tuned amplifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. . .21 Delta modulation . . .22 TDM . . . . . . . . .13 Study of CMOS PLL 4046 . . . . . . . . . . .5 AM detection . . .24 BPSK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. . . . . . . . . . . . . .

.6 Subtraction of 32-bit binary numbers . . .16 Binary multiplication . . . . . . . . . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . . 4. . . . . . . . . . . 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . . . 7 146 146 148 149 149 150 151 152 154 155 156 157 158 159 160 161 162 164 165 166 167 169 170 171 174 175 187 187 189 190 191 192 193 194 195 196 197 198 199 . . . . . . . . . . . . . . . . . . .23 Generation of waveforms . . . . . . . . . . . . . . . . . . . .25 ADC interface . . .9 Binary to BCD conversion . . . . . . .12 BCD to binary conversion . 3. . .6 Largest/smallest in an array . . .3 Overlapping block transfer of data .5 Subtraction of 16-bit binary numbers . . . . . . . . . . . . .11 ASCII to Hex conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 Stepper motor interface . . . . . . . . . . . . . . . . . 3. . . . . . . 3. . . 3. . . . .19 Factorial of a number . . . . . . . . . . . . .10 Multiplication of 16-bit binary numbers 4. . . . . . . . . .4 Addition of 32-bit binary numbers .2 Block transfer of data . . . . . . . . . . . 3. . . . . . . .22 Display character from keyboard . . . . . . . . . . . 3. . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . . . . . . . . . . . 4. . . . . . . . . . . . . . . . . . . . . . 4. . . .8 Multibyte addition . . . . . . . . . . . . . . . . . . .24 Waveform generation using DAC . . . . . . . . 3. . . . . . 3. . . . . .17 Binary division . . . . . . . . .2 Block move of data . . . . . . . . . . . . . . . Microprocessor lab-8086 (using MP kit) 4. .21 Rolling display using 8279 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Exchange of data between memory blocks 3. . . . . . . . 4. . . . . . . . 3. . . . .8 BCD to binary conversion . . . . 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 Number of occurance . . . . . . . 4. . . . . . . . . . . . . 4. . . . . . . . . . .7 Sum of array elements . . . . . . . . . .3 Addition of 16-bit binary numbers . . . . . . . . . . . . . . . . . . . . . . . . 3. . . .7 Sorting in ascending/descending order .18 Square root of a number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 Binary addition . . . . . . . . .14 BCD addition . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Familiarisation with microprocessor kit . . . . . . . . . . . . . . . . . . . . . . . . .1 Familiarisation of MP trainer kit . . . . . . . . 3. . . . . . . . . . . . 4. . . . . . . . . . . . . . . . . . . . . 3. . . . . . . . . . .10 Hex to ASCII conversion . . . . . . . . .11 Division of binary numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 . . . . . . . . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . . 3. . . . . . . . . . . . . . . . . .15 BCD subtraction . 3. . . . . . . . . .13 Multi-byte addition . . . . . . . .Electronics Lab Manual Volume 2 3 Microprocessor lab-8085 3. . . . . . . . . . . . 4. . . . . . . . . . . .9 BCD addition/subtraction .

. . . . . . . . . . . . . . . . .12 Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 Case conversion . . .17 4. . . . .5 Sum of array elements . . . . . . . .6 BCD addition . . . . . . . . . . . .25 5 Binary to BCD conversion . . .15 4. . . . . . . . . . . . . . . . .14 Drawing triangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 4. . . .5 Addition of two two-digit numbers . . . . . . . . . .3 Display of strings . . .7 Reversing a string . . . . . . . . . . . . . . . . . . . . . 5. . . . . . . . . . . . . . . . . . Square root of a number . . 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 201 202 203 204 205 207 208 209 210 212 213 215 219 219 221 223 224 227 229 230 232 233 234 236 238 239 240 Microprocessor Lab-8086 (using MASM/TASM) 5. . . .2 Block move of data . . . . . . . . . . . . . 5. . . . . . . .24 4. . . . . . . . .1 DEBUG Program . . . . . . . . . . . . . . 5. . . . .22 4. . . . 249 249 251 252 253 253 255 7 . . . . .4 Addition of two single digit numbers . . Fibonacci series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Microprocessor lab-8086 (using DEBUG) 243 6. . . . . . . . . . . . . . . . . . 243 Microcontroller lab-8951 (using MC kit) 7. 5. . .19 4. . . . . . . . . . . . . . . . . . . . . . . . . . .20 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rolling display . . . . . . . .3 Number of occurance . . . . . . . .13 Drawing line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5. . . . . . . . . . . . ADC using interface card . . . . . . . . . . 5. . . . . . . . . . . . . . . . . . . . Finding LCM and GCD . . . . . . . . . . . . 5. . . . . . . . . . . . . . . .2 Familiarisation of DOS and BIOS interrupts . . . . .16 4. . . . Largest/smallest in the array . . . . . . . 5. . . . . . . . . . . . . . .1 Familiarisation with MASM/TASM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Prime number generation . . . .18 4. Multiplication of 32-bit binary numbers Stepper motor interface . . . . . . . . . . . . . . 5. . . 5. . Sorting in ascending/descending order . . . . . . . . . . . . . . . . . 5. . . . . . . . . . . . . . . . . . . . . . . . .8 4. . . 7. . . . . . . . . . . . . Electronics Lab Manual Volume 2 . . . . .11 Fibonacci sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 Addition of a set of numbers . . .21 4. . . . . . . . 7. . . . . . . . . . . . . . . . . . . . . . . . . .9 Concatenation of strings . . . . . . . . . . . . . . Waveform generation using DAC . . . . . . . . . . . . . . . . . . . . . . . . . .13 4. . . . . . . . . . . . . . . . . . . . . . . . . . .4 Addition of two 8-bit binary numbers 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5. . . . . . .23 4. . . . . ASCII to Hex conversion . . . . . .10 Checking for palindrome . . . . . . . . . . . . . . . . . . . . .1 Familiarisation with MC trainer kit . . . . . . . . . . . . . . . . . . .

. . . Addition of multi-byte numbers . . . . . . . . . . .19 7. . . . . . . . . . . .3 Bode plot of a system . . . . . . . . . .1. . 9. . . . . .8 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8. . . . . 9. . . . . Binary to gray conversion . .5 Generation of PWM signal . . . . . . . .6 Examination questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 7. . . . . . .4 Linear convolution . . . . . . . . . . .1. . . . . . . . . . .2 Generation of simple signals . 8. . . . . . . . . . .20 7. . . . . . . . . . . . . . . . . . . . Relay activation using optocoupler Examination questions . . . . . . . . . . . . . . . . . . .2 Gunn diode characteristics . . .18 7. . . . . . . . . . . . . . . . . . . . . .3 Reflex klystron characteristics . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . Finding largest . . . . 9. . . .1 Introduction to MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 SIMULATION LAB . . . . .1 Impulse response of an LTI system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9. . . . . . . . . .6 Magic tee measurement . . . . . . . . . . . . . . . . . . . . 9. . . . 9 MATLAB 9. . . . . . . .1 Familiarisation of microwave components 8. . . . . . . .2 SIGNAL PROCESSING LAB . 8. . . . . . . . . . . . . . Factorial of a number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 7. .5 VSWR measurement . . . . . . . . . . . . . . . . . .3 Generation of AM signal . . . . . . . . . . . . .8 Antenna measurements . . . . . . . . . .21 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . Hex to ASCII hex code conversion ASCII to hex code conversion . . .22 8 Division of 8-bit numbers . . . . . . . . 9.9 7. . . . .2. . . . . . . . . 9. . . . . . . . . . .1. . . . .4 Frequency and wavelength measurements 8. . . . . . . . . . . . . . . . . . . . . . . . . . 9. .16 7. . . . . . . Generation of square wave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 7. . . . . . . . . . . . .4 Generation of FM signal . . . . . . Square of a number . . . . . . . . . . .7 7. . . . . . . . .10 7. . . . . . . . . . . . . . . . . . . . . . . . . BCD to binary conversion . . . . . Sorting in ascending order . . . .2 Impulse response from transfer function 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8. . 9. . . . . . 9 256 256 258 259 260 261 262 264 264 265 267 267 269 270 271 273 275 275 280 281 283 285 287 289 291 298 298 298 300 303 304 305 306 308 308 309 311 312 Microwave lab 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . Square wave using timer . . . .12 7. . . . . . . . . . . . . . . . . . . . . . . .11 7. . . . . . . . . . .1. . . . . . . . . . . . . . . . .7 Directional coupler characteristics . . . . .Electronics Lab Manual Volume 2 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8. 9.13 7. . . . . . . . . .2. . . . . . . . . . . Binary to BCD conversion .2. . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Square root of a number . . . . . . . . . . . . .

. . . . . . . .21 9. . . . . . . . . . . . . . Moving average filter . . . . . . . 315 316 317 318 320 324 325 326 327 329 331 332 334 336 338 349 353 356 359 362 363 364 365 . . . . . . . . . . . . . . . . . . . . . . Linear convolution using circular convolution . . . . . .18 9. . . . . . .14 9. . . . . . . . . . . . . . . .7 9. . . . .2. . . . . . . . FIR filtering using CCS .8 9. . . . . . . .2. Examination questions . . . . . . . . . .2. . . . . . . . . . . . . . . . .12 9. FIR filter using Blackman window . IIR lowpass filter . . . .13 9. .2.24 9. . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . Introduction to DSP development system .2. . . . . . . . . . . . . . . .5 9. . . . . . . .2. . . . . . . . . Linear convolution using DFT . .2. . .2. . . . . . . . . . . . . . .16 9. . . . .22 9. . . . . . . . .2. . . . . . . . . .2. . . . . . . . . . . . . Generation of sine wave using CCS . . FIR bandpass and highpass filters using windows FIR highpass filter . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . .20 9. . . . . . . FIR filter using rectangular window . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . .10 9. . .23 9.17 9. . . . . . . . . . . . . DFT and IDFT . . Circular convolution . . . . . . IIR filter with input frequencies in Hz . . . . . . . . . . IIR filtering using CCS . . . . . . . . . . . . . .2.2. . . . . . . . Creating and building projects in CCS . . . . . . . . . . . . .10 9. . . . .2. . .2.25 9. .2. . . . . .6 9. . . . . . . . . . . . . .27 Electronics Lab Manual Volume 2 Deconvolution . . . . . . . . . .11 9.2. . .9 9.19 9. . . . . . . . IIR filter design using MATLAB functions . . . . .15 9.26 9. . . . . .2. . . . . . . . Circular convolution using DFT . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . FIR filter using Kaiser window . FIR filter using Hamming window . . . . . . DFT and IDFT using matlab function . . .2. . . . . . . . . . . . . . . . . . . .2.

#U: Unassembler. This command is used to examine the contents of selected memory locations and modify them. 8086 microprocessor MICRO-51 LC trainer kit manufactured by Vi Microsystems Private Ltd.1 Familiarisation with MC trainer kit Aim To familiarize with 8951 microcontroller trainer kit having in-built assembler. Syntax: #U<CR> #SP. Syntax: #R<CR> #GO Go and execute. This command is used to enter the mnemonics of 8951 and it gives the opcode for the mnemonics. Syntax: #SP<addr><CR> for program memory #SD<addr><CR> for data memory #R To examine and modify the register contents of the CPU. The Go command is used to run the program. Syntax: #GO<addr><CR> 11 . Chennai has in built assembler and disassembler.Chapter 1 MICROCONTROLLER LAB-8951 (USING MC KIT) 1. It gives the mnemonics and corresponding opcodes in the given address.. A SSEMBLER COMMANDS #A Line assembler. SD Substitute byte. Syntax: #A<CR> Enter user RAM address and program.

This command deletes blocks of bytes and words respectively from memory. Syntax: #EP <start addr ><end addr><program end addr><CR> for program memory #ED <start addr ><end addr><program end addr><CR> for data memory #IN Input byte. Syntax: IN <port addr><CR> #O Output byte. Syntax: #FB <start addr><end addr><byte data><CR> for program memory #FD <start addr><end addr><byte data><CR> for data memory #MP. ID This command inserts the specified bytes in the desired memory location. ED Delete.12 Electronics Lab Manual Volume 2 Go with break point Syntax: #GO<start add ><end add><CR> #TR Trace command. This command will be very helpful while debugging programs. . 2. Type in the starting address and press enter. Syntax: #IP <insert addr ><program end addr ><No. Enter the mnemonics..e. Syntax: #MP <start add><end addr ><dest addr> for program memory #MD <start add><end addr ><dest addr> for data memory #IP. Switch on the 8086 kit. This command inputs bytes from the desired port. This command helps the user to execute program in steps. of bytes><CR> for data memory #EP. This command outputs data to the desired port. FD This command permits a block of RAM memory to be filled with desired data type. Syntax: #TR <addr><CR> #FP. of bytes><CR> for program memory #ID <insert addr ><program end addr ><No. This command moves the content at a specified block of memory to another block whose starting address is specified in RAM. MD Byte move. i. Type A and enter. Syntax: IR <Addr ><CR> H ARDWARE SPECIFICATIONS Monitor EPROM : System RAM : User RAM : 0000:3FFFH & FFFF 4000:BFFFH 4100:BFFFH Procedure to enter a program 1. Syntax: O <port addr ><data><CR> #IR This command is used to view the bytes in the internal RAM locations. instruction by instruction. 3.

A MOV DPH. Continue till counter is reset . in Acc. Enter the program in memory locations starting from 4100H. Procedure to execute the program 1. Press ’.05H MOV DPTR.2 Block move of data Aim To write a program to move a block of memory from one location to another. Set byte counter.’ and enter or reset key. 3.#4500H MOVX A. . 3. 13 1. Length of block in R1 .46 MOVX @DPTR. 2. Type #GO starting address of code and press enter key. Points next location . Execute the program and verify the result in memory locations starting from 4600H.@DPTR MOV DPH.Electronics Lab Manual Volume 2 Procedure to enter data 1. Decrement counter and repeat the above step until the byte counter is reset. Update the locations with desired bytes.45H INC DPTR DJNZ R1. Five numbers stored in memory locations starting from 4500H must be moved to 4600H onwards. 2. 3. 2. Press INT key. Test data Input: 4500: 01 02 03 04 05 Output: 4600: 01 02 03 04 05 . Halt NEXT: HLT: Procedure 1. Number moved to 4600H .NEXT (4105H) SJMP HLT (4110H) . First address in DPTR . 3. Algorithm 1.’ and enter. 4600H in DPTR . Press ’. 4500H in DPTR . 2. Get the number from the source and copy it in destination. Program 4100: 79 0A 4102: 90 45 00 4105: E0 4106: 75 83 46 4109: F0 410A:75 83 45 410D:A3 410E: D9 F5 4110: 80 FE MOV R1. First no. Enter five numbers in memory locations starting from 4500H. Type #SP address and press enter key.

Enter the program in memory locations starting from 4100H. Store the sum and carry in the memory. Carry is reset .#00 MOVX A.@DPTR ADD A. Test data Input: 4300: 75 4301: 65 Output: 4302: 40 4303: 01 . Execute the program and verify the sum in memory location 4302H and carry in 4303H. Description One 8-bit packed BCD number is available in the memory location 4300H and another number is available in the memory location 4301H. Add both numbers . Else increment carry .A SJMP HLT (4113) . Result in destination address . 3. skip .A MOV A. Get the BCD numbers from the memory locations.A MOVX A.R1 INC DPTR MOVX @DPTR.@DPTR INC DPTR MOV R0. Enter data in memory locations 4300H and 4301H.6 BCD addition Aim To write a program to add two BCD numbers.R0 DA A JNC NOC (410E) INC R1 INC DPTR MOVX @DPTR.Electronics Lab Manual Volume 2 17 1. Result is available in the location 4302H and carry in 4303H. 2. Store carry . Second number in A . 2. Convert to BCD . Address of first BCD number . Pointing to second number . Algorithm 1. If no carry. 3. Add the BCD numbers with the help of DAA. First number in A . Halt NOC: HLT: Procedure 1. First number in R0 . Carry in A .#4300H MOV R1. Program 4100: 90 43 00 4103: 79 00 4105: E0 4106: A3 4107: F8 4108: E0 4109: 28 410A:D4 410B: 50 01 410D:09 410E: A3 410F: F0 4110: E9 4111: A3 4112: F0 4113: 80 FE MOV DPTR.

2.@DPTR CLR C RRC A MOV R1. add each adjacent pair of binary digits to get the next gray code digit. Address of the number . Disregard carries. . Going from left to right.@DPTR XRL A. Test data Input: 4200: 90 Output 4201: D8 1.26 Electronics Lab Manual Volume 2 1. Program 4100: 90 42 00 4103: E0 4104: C3 4105: 13 4106: F9 4107: E0 4108: 69 4109: A3 410A:F0 410B: 80 FE MOV DPTR. 3. Enter the number in memory location 4200H. Number again in A .A MOVX A. Rotated number in R1 . Algorithm 1.#4200H MOVX A. Store result in 4201 HLT: Procedure 1.A SJMP HLT(410B) . XOR rotated and original numbers . a decimal number. Execute the program and verify the result in 4201H. Enter the program in memory starting from 4100H. 2. Hexadecimal number is in the memory location 4200H and ASCII number must be stored in the memory location 4201H. Rotate through carry .14 Binary to gray conversion Aim To write a program to convert an 8-bit binary number to equivalent gray code.R1 INC DPTR MOVX @DPTR.15 Hex to ASCII hex code conversion Aim To write an assembly language program to convert an Hexadecimal number to its ASCII Hex Code equivalent. Theory The American Standard Code for Information Interchange (known as ASCII) is a 7bit code with 128 combinations and each combination is assigned to a letter. Keep number in A . The MSB in the gray code is the same as the corresponding bit in a binary number. Clear carry for rotation .

Enter the number in memory location 4200H.R1 INC R1 INC R1 DJNZ R2.17 Square of a number Aim To find the square of a given number. .@DPTR JZ RESULT (4110) MOV R2. Store result Procedure 1. store it .Electronics Lab Manual Volume 2 29 1. Set number as counter .#4200H MOVX A. Add odd numbers starting from zero until counter is zero. LOOP (410B) RESULT: INC DPTR MOVX @DPTR. add three odd numbers starting from 1. Program 4100: 90 42 00 4103: E0 4104: 60 0A 4106: FA 4107: 79 01 4109: 74 00 410B: 29 410C: 09 410D:09 411E: DA FB 4110: A3 4111: F0 4112: 80 FE MOV DPTR. store EE in 4201H to prompt error message. Test data Input: 4200: 05 Output 4201: 19 19H = 2510 1. Number in Acc. Execute the program and verify the result in 4201H.A HLT: SJMP HLT (4112) . Add progressively . Continue till counter = 0 .A MOV R1. . In order to find the square of 3. Enter the program in memory starting from 4100H.#01 MOV A. 2. 1 + 3 + 5 = 9. To find the square of 5. If not.#00 LOOP: ADD A. First odd number . Algorithm 1. If number is zero. . 2. 3. Theory The square of a number can be calculated by adding consecutive odd numbers starting from 1. Next odd number . 1 + 3 + 5 + 7 + 9 = 25.18 Square root of a number Aim To calculate the square root of a given number in the address 4200H and store it in 4201H if it is a perfect square. Set the number whose square is to be calculated as the counter.

Arrange the numbers in the reverse order. a2 . 7. Generate a triangular waveform and display it on the C. Write a program to separate the addresses in an array where odd numbers are stored (Only the lower bytes of addresses). 13. Assume values for numbers. Write an ALP to obtain x2 + y 2 . rotate in counter clockwise direction. 1.22 Examination questions 1. 14. shift the array to 4300H. Write a program to subtract two multi-byte BCD numbers. Execute the program and connect the P1.. a9 . Write and ALP to generate a square wave of frequency 1 kHz and duty cycle 40%.O. 4. a8 . An array of numbers are given. Set up the circuit on a bread board and enter the program in memory starting from 4100H. 18. a5 . . 20. 5. a7 .. Rearrange the array as shown below: a2 . Change the delay and observe the change in timing. Write a program to add two 3 × 3 matrices. Write an assembly language program to light two sets of LEDs alternatively. 2. If the sum of array elements is even. 3. 15. where x and y are two nibbles. a4 . 2. 11. Write a program to subtract two 4-digit decimal numbers. If the sum of the numbers is odd. Write a program to arrange it in ascending order. 12. A set of non-zero bytes are stored in locations 4100H onwards.0 pin of microcontroller to optocoupler.R. Write a program to shift the array to memory locations starting from 4200H if the sum of array elements is odd. Write an ALP to prove Pythagoras theorem. An array of numbers is given. 20 numbers are stored in location 4400H onwards. Write and ALP to rotate a stepper motor clock wise for 360◦ degree. Write an assembly language program to exchange a block of data. 19. Write an assembly language program to check an string whether it is a palindrome. rotate the stepper motor in clockwise direction. a10 . a3 . Write a program to sort negative and positive numbers. 3. Write an ALP (assembly Language program) to find the transpose of a 3 × 3 matrix. Write an ALP to multiply a 3 × 2 matrix by another 2 × 3 matrix. An array of numbers a1 . 21. 6.a10 are stored in location starting from XX00. a3 . 16. Observe that the bulb blinks intermittently. 17. 9. 8.5 rotations.. Write and ALP to rotate a stepper motor counter clockwise for 1. a1 . The last byte in the data set is indicated by the entry 00H. 10. If it is even. a6 .Electronics Lab Manual Volume 2 Procedure 35 1.

com .For Copies. Girinagar South Kadavanthra. Kochi-682020 Phone: 0484-2313911 e-mail:rajathpbs@yahoo. Rajath Publishers 28/450-A. Club Road.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.