You are on page 1of 12

EE/APR 2008/KJE609/ECE590

CONFIDENTIAL

UNIVERSITI TEKNOLOGI MARA


FINAL EXAMINATION

COURSE

ELECTRONICS AND MICROPROCESSORS

COURSE CODE

KJE609/ECE590

EXAMINATION

APRIL 2008

TIME

3 HOURS

INSTRUCTIONS TO CANDIDATES
1.

This question paper consists of five (5) questions.

2.

Answer all FIVE questions only in the Answer Booklet. Start each answer on a new page.

3.

Do not bring any material into the examination room unless permission is given by the
invigilator.

4.

Please check to make sure that this examination pack consists of:
i)
ii)
iii)

the Question Paper


a three - page Appendix - MC68000 CPU instruction
an Answer Booklet - provided by the Faculty

DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO


This examination paper consists of 9 printed pages
Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

EE/APR 2008/KJE609/ECE590

CONFIDENTIAL

QUESTION 1
a)

State the differences between an extrinsic and intrinsic semiconductor materials.


(5 marks)

b)

Illustrate the connection of a PN junction diode with the power supply during forward
bias and reverse bias; and explain what happen to the depletion region in both cases.
(5 marks)

c)

The circuit in Figure Q1(c) below shows the block diagram of a DC power supply
system.
i)
ii)

Draw and label the voltages marked VA, VB, VC and VoutIf voltage VC is produced using an RC filter, calculate it's percentage ripple.
The values of the capacitor and resistor used in the filter are 50 uF and 2.5 KQ
respectively. The AC supply voltage has a frequency of 60 Hz. Assume that
the diodes were ideal diodes.

VA

VB

VCQ
Vout

FULL WAVE
RECTIFIER

240Vac

FILTER

REGULATOR

200:10
Figure Q1(c)
(10 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

EE/APR 2008/KJE609/ECE590

CONFIDENTIAL

QUESTION 2
a)

Figure Q2(a) shows a single-stage common emitter amplifier using a BJT transistor
having the DC gain (3 of 150.
Given that Vcc = 20 V, Ri = 40 kQ, R2 = 15 kQ, Re = 1 kQ, RE = 1.2 kO.

Vcc

R1

R2

Figure Q2(a)
For the transistor, take VBE = 0.7V, determine :i)

The Base voltage VB.

ii)

The Emitter voltage VE.

iii)

The Emitter current IE, Base current IB, and Collector current l c .

iv)

The Collector voltage Vc and draw the DC load line for the transistor.
(8 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

EE/APR 2008/KJE609/ECE590

CONFIDENTIAL

b)

For the circuit shown in Figure Q2(b) below, calculate :i)

The transresistance value, re.

ii)

The input impedance ZiN , and output impedance ZOUT-

iii)

The voltage gain, Av.

State and explain any assumption/s made during the analysis.

Ri=220kQ
Rc=2.2kQ
(3=60
Vcc=12V
ro=4OkQ
VOUT

Figure Q2(b)
(12 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

EE/APR 2008/KJE609/ECE590

CONFIDENTIAL

QUESTION 3
a)

For the operational amplifier circuit in Figure Q3(a) below :i)

Derive the output voltage Vo, in terms of input voltages and the resistors,

ii)

Calculate the output voltage Vo, given that :V1 = 1V, V2 = 2V, V3 = 3V and V4 = 1V.
The resistor values are Ri = 500 kQ, and R2 = R3 = R4 = Rf = 1 MQ.

iii)

If the output voltage Vo is equal to - 4V and the current that flows through
resistor Ri, R2, R3 and R4 has equal value, find the current flowing in Ri and
the voltage V3. The value of resistor R3 is 2 kQ and Rf is 1 kQ.
(14 marks)

R1

AAA/
R2
A/V\
R4

Figure Q3(a)

b)

Using an 8 to 1 multiplexer and other logic gates, implement the Boolean function
below :-

f(A,B,C,D)= AB +CD + BD + ABD


(6 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

EE/APR 2008/KJE609/ECE590

CONFIDENTIAL

QUESTION 4
a)

Convert the following numbers into the number system stated. Show all the
calculations involved.
i)

01110001102 convert into octal number

ii)

2548 convert into decimal number

iii)

12910 convert into hexadecimal number

iv)

AE16 convert into binary number


(4 marks)

b)

i)
ii)

Deduce the Boolean expressions for output X and Y in terms of the input
variables A, B, C and D for the circuit of Figure Q4(b).
Obtain the simplified expression for Y using the K-map method.

f>

D-

Figure Q4(b)
(8 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

EE/APR 2008/KJE609/ECE590

CONFIDENTIAL

c)

Analyze the asynchronous counter circuit of Figure Q4(c) below. All JK and SET
inputs are connected to logic "1". Hence :i)
ii)

determine the counting sequence and the MOD number of the counter.
sketch the waveforms of QA , QB and Q c up to 5 clock pulses.

CLK

Figure Q4(c)
(8 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

EE/APR 2008/KJE609/ECE590

CONFIDENTIAL

QUESTION 5
a)

Explain the function of the components of a microcomputer system stated below.


i)
ii)
iii)

random access memory (RAM)


arithmetic logic unit (ALU)
general purpose registers
(5 marks)

b)

Determine the contents of the registers and memory locations that are affected by the
following MC68000 CPU instructions. The initial values inside the registers and
memory locations are as shown in Table 1 and Table 2 below. Assume that before
each instruction is executed, the registers and memory locations are restored to their
original values. Every instruction is not related to each other.
Table 1: Initial register contents
DATA REGISTERS

ADDRESS REGISTERS

D0=$78904536

A0=$00005000

D1=$FFCB5A8B

A1=$00005001

D2=$FFFFFC18

A2=$00003000

D3=$0000186A

A3=$00003001

Table 2: Initial memory contents

i)
ii)
iii)
iv)
v)

MOVE.W
MOVE.B
ROL.W
ADD.B
OR.B ,

ADDRESS

DATA

$3000

$32

$3001

$57

$5000

$BC

$5001

$6D

DO, D2
D3,(A1)
#3, D1
(A0), DO
(A2), D2
(5 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

EE/APR 2008/KJE609/ECE590

CONFIDENTIAL

c)

Figure Q5(c) shows the MC68230 Pl/T connection to a 7-segment display unit. Draw
the flowchart and write a MC68000 CPU assembly language program that will display
the number 3, only when both switches SW1 and SW2 is pressed. All other states of
SW1 and SW2 causes the display to show number 0. Assume Port A and Port B are
already initialized as output and input port respectively.

PAO-PA:

BCD to
7-segment j
Decoder

MC68230
Pl/T
+5V

God

Figure Q5(c)
(10 marks)

END OF QUESTION PAPER

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL

Copyright 2004 By: Chuck Keiry

EASy68K 68000 Quick Reference v1.5 hltp/i


Effective Address
Ipcode Ik Operand m
ynntrn
k MW * ! m
akW
i l if/is
HDIPJJ

fit m
kk
I wk
ir 51 #n.ds
IL kk
11 i ! By,O?

il

Sfjjtl

IL kk
8 MB
i i ' ff
a IL
Ill)
USB
1 ds
Bee If label

ffiffi 81 kk
kk
S
L
Buds
ECU)

d.PC) l In
Add 18 will tod

* * * ** if sr
ds

is

sr
ds

sr

s?

is ds

sr
k

sr
k

SP

sr ST+BB-JDH

SP

ds

]i+ds->is

El SP SP SP SP sr
sr
*** ** ds ds ds
ds ds k ds ***** ds is ds ds h ds ds k ds Sf sr

-HflO
*****
*****

Si1

sr

SP

ds ds k ds OS k
ds ds k ds ds is

- -

ds

SP

ds
ds
-

sr

Sf

SP

ds
-

SP

Add aidress (.W sign-extendedtoA)

- la+ds -> is

Add immediate

fi+ds^js

IddMiclifflftedielliiiplbl

Qy+Ox+X->Dx

Addwiby

sr SP sr&Dn->Dn

fklds^s
- fit Ids-) sis

MCLM1
MM

**^ * H

!S!

I1

ds ds k ds
-

ds
ds ds
ds ds
ds ds
ds ds
ds ds

is

BKJl If lab!
*
is'
OSET n [ids
k
ids
bb!
B
S
R
ES!
hk __* is1 ds ds
Is1 ds ds
hk
ci f SP,I -muu Sf SP Sf
cm i i ds -0100 k ds ds
C
M
P 81 sr,Bn
SP sr s?
3
_****
Cl i srJto
SP sr Sf Sf
1
ds ds ds
HI iL Itijs

IL ( ? } *
ea
-
ice I Itilafeel

w
n

ds

ds

ii

#rufs

.opIMIO
^AtlOl is usei when sotires is #n)
.opalJlihffltt
,oa3cai AHO Immediate to CCR
aliiiraeiatets^!Prislgei})
Arithmetic shift Dy 0^ bits bft/>ight

tABffl or ADIK1 is used vheet source is #n)

Sf

Add binary

Sf

*****
-**oo

Oeicriptioii

Operation

*U*o* -

Juds

m-l

EE/APR 2008/KJE609/ECE590

APPENDIX 1(1)

ds

ds

ds ds
i ds
is ds

ds

ds

ds

iiititicsiftDfliilisU lit: 1 loll


iifhelsidsiiileft/#r(.lii?]
-

ds

is

ds

ds

ds

l a i ittnlfeltefeHe K? pgt
(d:8/i-lihigidifeiip)

l l l f m b f o f i s ! ^ Set 2 witt state of speciffedbit in is then

illimtefdl^I ietZiii state of speeieliii!iistlie!i

rf ec true then
PC*d->PC

IKLiifiofii^iiBfds invert lie i ids

- -

@->ifflikpsfds

clearfclit ii ds

R4lK
WIViukkHl
i^ttaifds
PI->-(SPkPC*d-PC

Branch i t e p Id: l/i-iit sigid i i t e l

NflT(bllDriQfds)->Z

Set Zwift state of spBciftei bit in is

lllliefdsl^I

toe fell ids u i b p d

Set Z will state of spaclfWfeltiE is then


sgtieiiiE
ifatiifosiftreii{sl:S/!6-lsit sip-lit)

i ds ds
k ds k i ds ds
sr SP sr sr sr
k ds ds k ds -

ds
ds

sr sr firfofikriffllP
- - i-^ds

Edpre Do w l I] i d oppertafil [sr]

SP sr

SP

if

SP Sf

sr SP set CCR with Dn - sf

Cwtpare Qn to source

SP SP

SP

it

SP

sr
ds -

SF SF setCffislk-f

EnfafeAitosirce

ds

k ds ds i
- ' - *

- set CCRvfiihds-#n

sitCffiilW-i)

SfearteMontozEfD

Irapredesttiitiifc
loipare{k)toif];lMreraffllkSli

fccfa!seten{Dn-I->On IestMiiiii,di;raeit^lra!cfi

ifOs<>-itbPW-)PE} (dJ-isigiditeprS

m
m

1 srln
I srjn

_***Q

sr

SP

sr

sr

SP

sr

Sf

s? i/iisf^iBn ii:[i-ijitfeffliilep,IS-eipietitj

sr SF SP sr

SP

sr SP sr

Sf

sr lll/lilsr^ia

SP

Hak Cipta Universiti Teknologi MARA

SP

Si= [ |-|it renaWer, Mi qiient ]


CONFIDENTIAL

CONFIDENTIAL
Continued
i l Bui -**OO

IL ftijs
ill' 3 #nXCR
it

EI

W#n.SR

-**OO
*****
*****

My

EH ii On
ds
ds
wk
kk

ia
H
IK

it

Kifiy

spjCCR

1 srSR
1 SRjds
- ISPAi

m
or
m

dMDii
#ti,Dn
sp.0n
sr.On
8 ds
'! ds
I I ds

il
8
W
i

Duds
ln,ds
#n,Cffl

Lopical effibsive 01 Dn to ds
[opal e i b i e i f i tods
[opal sriusive Oils to CEI

Exchange registers (S2-bii onW

register <-->feptif

SsJ4flftl|[kf4fcl SliiextdfcbgeJtoliffio.Li

-
ds -

ds ds ds k ds ds
SP

sr

sr if

Sf

EessFalt i b a i instruction exesption

ds ds ds k ds ds

ds Sf

Sf

ds4PC
FC-MSWs-^C

imptoadfes specified M s

sr -> An

LosJ sifeotivB address of sr to An

SP**t4SP

Create bsai warfepce m stack


(ii must lie neptive to fate!)

pesh PC, jumptosubrouiias at asdress ds

ds ds k ds is

i k

-**00
*****

ea sr ia ea m ea ea Si ea sr
sr Sf sr sr sr IP sr sr sr
***** Sf - sr Sf sr SP sr ir sr Sf
ds ds ds ds ds k k ds

SP

Sf SP ->ds

sr sr
sr sf4SR

SR->ds
IP -> in

Jta-1BP
sr

SI'

sr

sr

OS

sr
Is

sr sr
~

Sf

SP

ds

is

sr

SP

sr
ds
sr
-

sr
ds
sr
-

SI*

Sf

sr
-

sr
-

sr
SP sr
ds ds
ds ds
ds ds
- -

SP

sr

SP

SP

-**OO

sr
- * * O O sr
u*u ds
***** ds
***** ds
- * * O O ds
- * * O O sr
-**0O

-**OO
*****
*****

ds

RESET
ROL
BIL Mi
#n,Oy
ds
ii BIL OiDy
ii
#n,D?
ds

Balds^i
fe!ds->ds
fell ffl^CCR

looica! eschisive QS #B to SR (Ppiviteged)

ysp

US
Hill w
ICO
KEE
HI
IP
KDT i l ds
01 BVL srln
1

IIP in ft!*)

01!

***g*

WL pr '
t Rn-ftn.ds
sr,l?n-fe

mm

ea 63

fnlv

ds
IL ea,ea

i?E 1

m
m
m

ds ds k ds ds & k
ds ds
ds ds k k
- -

Ji
JSS

LSL

ds
ds
-

-'00

ILLEGAL

EE/APR 2008/KJE609/ECE590

APPENDIX 1(2)

ds
-

sr
sr
ds
ds
ds
ds

SP

sr
ds
ds
ds

ds
SP sr
ds ds
ds ds
- - ds -

sr
sr sr
is ds
is ds
is ds
- is ds
SP sr
ds
ds ds
- - ds
SP

SP
SP

ds
ds
ds

sr

ds

4 ds

SP

SP

is
ds

ds

sr
ds
ds
as ds

sr

s? - > An

#nORSR->5R
ds-MS?)
Assert RESETUw

ds ds ds ds

ds

sr

sr

ds

ds

t-M

is ds

***Q*

C*w

ds ds Js ds

Hak Cipta Universiti Teknologi MARA

is

k ds

Iifisfa!afrain3oiirc?tod?stiaiii
l a s ssuree lo D^ndmon Cede fegistsr
h a siurce b Status liegister IFAifeisIl
Move Stilus Register to destiiatbn
l e w Her M t Pointer to k (Psiiege!
fa k te User Staei: Poisr (PrMlepl

Hare source to k ( I f srinuse WEI.)


tea specified rssisters fa/from itierttary
fagiste -> ds
sr -> legistsrs
Llf source is sigB-estemlei to iferHnS
- h->dtibUt2(Aii!LiM(* ims Onta/fremalternate mmey bytes
d^0tl;MfliiMi (Access only sviti or odd address^)
isve sign u M k i 8-hil l lo fc
#B->Dn
sr !litsr*lftOi^& i l p l ? sipd IB-bit; m i l sped 32-bit
Wiplf suisi i li-iil-result:uasig'd 22-sii
SP ieiiisr*ii Unfits
- D-ds-l(->ds
feptsBCOwittEnrf
- 0-ds-ds
fejate is
- 0-ds-K-^ds
tefatgJswftliErfssI
- he
looperatioBiicffii's
lopcal i f (aes compfement of ds)
IW-Hs
srlfti^ia
OnORds^-ds
1DRI is usedtthensource is fit)
Logicai Dl #n to ds
litiik-Hs
kpaillntoCK

-**g*

Loi'rahhMfJxfeisif/figlit
Logical shift Ov. #n biis L/R (#n: 1 to 8)
LogieaJ shift ds i bittoft/rightLW onlv)

kpalilnfolfFpiAgsi)
Push effesfe address sf ds onto slack
issee a hantoare RESET (Prfflfega!)
SDtate
Oy, Qx bits Jeft/rJght {wittout X)
*J
hhbDr.ftlifeleft/i$(hlto8}
fctatedsWfeft/iiiWilKl)
iotate 0v, DX bits L/R (Xussd tten
mJ
updated)fotatsfeIn tefeft/rigltf#n:i
to 8)
folatedsl-lHi/iiWff*
CONFIDENTIAL

CONFIDENTIAL
Continued
I

*****

m
m

SBCO 8 Bv.fc
mm
Sec B k

t[U{}T

il

l sr,in

SI

sr sr
ds ds

is
sr sr sr
ds ds k
ds k ds k ds

SLCI- l i kk
SliBO- fill #n.ds
I I Dyjh

* r * * *
**--* +

ds is k

^f

T * * *

On.ds

k k 3s k

sr.Ori

In

SI

1 On
B ds

lip

Test

false

HP
[?

hiaji
IC&IZ PI plus
b or sarse c*? Ml minus

not aqual

eod

IZ
I

ff cc is true then I's ^ is


ibfi's-Hs

Ifcctefendsl-iiiniii

fillip

fa In to SI. stop psesss" (Nfcd)


SuitractSiifflPi
(ilorilisiedwbiiQUiwisfiij

ds- fluids

it

sr

k k k ds ds
-

k k -

cc Condition
VC overflow ebr
ovsffbw set

"Isipd)

lest

!f
I
i
II

it gfesterorapl N&V+1N&IV
II bsian
M&ilf+!lfi

SI greater ten I1I!W!?


If bsorsqual Z+H&IV+W&V
iWtv-2004

Subtract taidiste

- ds-lii4ds

Subtract pfcfe fmriiite ( l i mm. Ito1


Subtract wfth Extern!

&HfeH4-(kS
- fe[3i]f4isPi
U i g e i e IE-it tote a fe
- !isHs4H;l4Bofi N SRHI Z settoref leel ds,fciffef ds settof

Pusi P and i . K set tf w!ei" iabls In


factortiifee i N - ^ (inrapBio IS)

tsslds->CCR

If overflow, e^scuie an Overflow TRIP


W Z set is reflect ds

in4i;(SPHin

fendralwispEebiistei

k Aedressregisfef (16/32-bit, 8=0-7)


Dn Batarepfcf | / i / 3 M i t r , = f l - l
h asfdifeor-airassiipter
PC
si1
#n
ea

else tB ^oooooooo

Sutetated'sp-entendfei)

in sr 4 k
ds - #55 -> ds

IfitelPi]

CDtidition
true

CE,ff carry clear !C


CUff tarry set

Subtract BCD wife Extern!

k
ds k
sr
sr SP srds ds is ds
ds ds k k -

sr

k k k ds ds k k
-

cc
I
F

0xr - OVID - X -> Dx!D

sr sr On - sr -> On

Condition Tests C & bgical AND, +logieal. WwiMl

1
E3

Returnfromescepfioii (Privilsgsd)
Return from subroutiftg arid rasters CCS
Return (pom subrautifie

sr

sr
k

SPMitfHFE

-*QQ

(5PK-)-> PC

Ox-Dj-BDi

IP!
1ST 11 k
IK

-00
_

In

(iHW

11

EE/APR 2008/KJE609/ECE590

APPENDIX 1(3)

SSP S i p w Stack Pomlsr (32-bit)


USP User Steek Pointer [32-bitl
SF Active Slack Pointer {sams as .47)

Program Counter* (2Wit)


label QesWon of Brand (teeibir dilates
Source
ds iednitbn
Isplacsmentrab}
Immediate data d
fefeirf
S8 Status Rsgister- (15-bit)
Effeiisffi lidress [mm c cestkiron) CCR M i t e Cede lepter Site? te of I )
Coded
flecimal
N oesatire, Z zero, oieifa, 11 cany, I extend
*seSadigteralofop!f3l
- not affected. Qcleared. Iset lluodsfeed

2
3

lib sies: 1 1 .S10to+121 bytes, .H or 1 - a Mfa+ 1 1 bytes

Distributed under tie Gil) psrel p i t usefeense.

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

You might also like