Welcome! Log In Create A New Profile

Advanced

2006 Exam Paper

Posted by ShaunGVW 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
2006 Exam Paper
November 02, 2007 08:17AM
Please can everyone input into the answers for last year's paper.
I haven't worked out all the answers yet, but at least people can start, and we can all learn. Please feel free to correct.
Here is the outline...

Question 1 (35 marks)
1a
B804 - 129A = A56A
4+16=20 20-10(=A)=10(=A)
F=15(was 0, carried 1)-9=6
7(was8)-2=5
B(=11)-1=10(=A)

1b
i) Overflow flag = 1st flag = NV = No overflow
ii) Next instruction's address to be executed stored in IP=0103. Therefore actual 20-bit address is IP + CS[0] = 0103h + 0D960h = 0DA63h
iii) 03E3h

1c
6B9Ch AND 24F8h = 2098h
0110 1011 1001 1100
0010 0100 1111 1000 (AND)
-------------------
0010 0000 1001 1000 = 2098h

6B9Ch XOR 24F8h = 4F64h
0110 1011 1001 1100
0010 0100 1111 1000 (XOR)
-------------------
0100 1111 0110 0100 = 4F64h

1d
i) imul ax,8 (????)
ii) shl AX,3
iii)
Mov CX,8
xor bx,bx ; zero bx
mov bx,ax ; store ax's value in bx
loop1:
ADD AX,BX
loop loop1

1e)
Location - Processor, Internal, External
Capacity - Word size, number of words
Unit of Transfer - word, block
Access method - sequential, direct, random, associative
Performance - Access time, cycle time, transfer time
Physical type - semiconductor, magnetical, optical, magneto-optical
Physical characteristics - volative/non-volatile, erasable/non-erasable
Organization

1f)
Hard failures and soft errors

1g
The no. of transistors in the CPU doubles every 18 months
(In fact, Moore denies he ever said 18, he maintains he said 24!!! - for free!)

1h
In comtext of computers, that it will support software written for previous models.

1i
3 - Digital Versatile Disk

1j
4 - (i)(0016)10 (ii)(0016)16
NASM considers all values as decimal, unless otherwise stated
DEBUG considers all values as hex, unless otherwise stated

1k
4
shr ax,2
23h = 0010 0011(2) goes to 0000 1000 (the last two 1's are moved out)
0000 1000 = 0008h

1l
4 - AX is multiplied by 2x2x2x2 = 16 (2 per shift)

1m
3 - DCh

1n
3 - the program is interpreted

1o
2 - Instruction pointer (see Study Guide 502 page 8, the section on Code segement CS & IP)

1p
2 - 65 535
dw = word = 16 bits
2^16=65536 -1 = 65 535 (since it starts from 0)

1q
[(zw)' + x']' + x + xy + zw
= (zw)''x'' + x(1+y) + zw
= zwx + x + zw
= x(zw+1) + zw
= x + zw
Therefore answer is 2

1r
xyz' + x'y + xyz
= xy(z'+z) + x'y
= xy + x'y
= y(x + x'winking smiley
= y
Therefore answer is 4

1s
5 - 20h

al = 0001 0011
bh = 0011 0011
--------------
al = 0010 0000 (after XOR)
= 20h

1t
3 - Code is often much slower

1u
2 - program segment prefix and is used by dos
Check Wikipedia for "Program Segment Prefix":
Extract: Alternatively, in .COM programs, one can address the PSP directly just by using the offsets listed above. 00h points to the beginning of the PSP, FFh points to the end, etc. For example, the following code displays the command line arguments:

Question 2 (35 marks)
2a)
2a (5 marks)
Disadvantages
Most ROMs are hard-coded during the manufacturing process can cannot be written to afterwards, where RAM can be read and written to quickly.
ROM is much more expensive than RAM.
More expensive

Advantages
ROM is Non-volatile, requiring no power to keep the content, where RAM is volatile, loosing its content once power has been removed.
ROM is used for microprogramming (eg: CMOS) where the content is of such a nature that it is fairly static, not requiring to be update.

2b)
No true comparison can be done between RISC and CISC since there are no true RISC and true CISC systems. The CISC systems have incorporated RISC features for performance and the RISC systems have incorporate CISC features. The comparisons have not been done on like for like machines, where the CISC systems would
typically have been toy machines.

2c)
Embedded computers typically serve a specific function where the other categories typically serve a more general type function.
Embedded computers are generally smaller than their counterparts.
Embedded computers are typically used in general house hold appliances (microwave, etc), vehicles, etc.

2d)
((A'BC)' + B'C'winking smiley' + AB
= (A'BC)''(B'C'winking smiley' + AB [...de morgan (x + y)' = x'y'...]
= (A'BC)(B'C'winking smiley' + AB [...double negative x'' = x...]
= (A'BC)(B'' + C''winking smiley + AB [...de morgan...]
= (A'BC)( B ) + (A'BC)(C) + AB [...distributive...]
= A'BBC + A'BCC + AB [...distributive...]
= A'BC + A'BC + AB [...idempotence xx = x...]
= A'BC + AB [...idempotence...]

...you can do:
= A'BC + (AB + ABC) [...AB = AB + ABC ...]
[...= AB(1 + C) ...]
[...= AB(1) ...]
[...= AB ...]
= A'BC + AB + ABC
= BC(A' + A) + AB [...distributive...]
= BC(1) + AB [...complement x' + x = 1 ; x'x = 0...]
= AB + BC

2e (3 marks)
ABC+DE*/+
= A(B+C)DE*/+
= A(B+C)(D*E)/+
= A((B+C)/(D*E))+
= A + (B+C)/(D*E)

2f
The study of assembly language leads to a better understanding of the cpu its internal organization and architecture. Programming in assembly language is generally good for compilers and I/O subroutines. The code is normally more efficient.

2g)
(i) MOV AX,102 immediate addressing
(ii) MOV AX,[201] Direct / displacement addressing
(iii)MOV AX,[si] Indirect Registar Addressing
And if you had Mov ax,bx it would be Registar addressing

Question 3 (30 marks)
(Programming question)
Re: 2006 Exam Paper
November 02, 2007 08:34AM
Mods applied to first post
Re: 2006 Exam Paper
November 02, 2007 10:22AM
Hey Shaun,
Sorry for not contributing yet - I'll start shortly.
for 2d I got as far as A'BC + AB. I'll have to do some more howework to figure out the next step.

The infix to post fix - eish, it seems I have quite a bit of work to do.
Re: 2006 Exam Paper
November 02, 2007 11:03AM
um, i dont have a copy of 2006's paper. where can i get one?
Re: 2006 Exam Paper
November 02, 2007 02:11PM
The 2006 Exam was included in TUT103. If you can't download it I'll mail it to you.
Re: 2006 Exam Paper
November 04, 2007 04:58PM
Hi,

I haven't worked through the whole paper yet, but I have completed Question 1 so far. Currently busy with Question 2.

My answers are the same as yours, except for the following:

1d 1)
IMUL AX, 8
1d 3)
MOV CX, 8
LOOP1:
ADD AX, AX
LOOP LOOP1

1e)
Location - Processor, Internal, External
Capacity - Word size, number of words
Unit of Transfer - word, block
Access method - sequential, direct, random, associative
Performance - Access time, cycle time, transfer time
Physical type - semiconductor, magnetical, optical, magneto-optical
Physical characteristics - volative/non-volatile, erasable/non-erasable
Organization

1f)
Hard failures and soft errors

1o)
2 - Instruction pointer (see Study Guide 502 page 8, the section on Code segement CS & IP)

1r)
xyz' + x'y + xyz
= xy(z'+z) + x'y
= xy + x'y
= y(x + x'winking smiley
= y
Therefore answer is 4

1u)
2 - program segment prefix and is used by dos
Check Wikipedia for "Program Segment Prefix":
Extract: Alternatively, in .COM programs, one can address the PSP directly just by using the offsets listed above. 00h points to the beginning of the PSP, FFh points to the end, etc. For example, the following code displays the command line arguments:
Re: 2006 Exam Paper
November 04, 2007 04:59PM
I'll post the rest of the questions as I complete them
Re: 2006 Exam Paper
November 04, 2007 07:06PM
Hi,

Here is my answers for Question 2 ... please let me know if you think anything is incorrect ....

Question 2 (35 marks)
2a)
Disadvantages:
Most ROMs are hard-coded during the manufacturing process can cannot be written to afterwards, where RAM

can be read and written to quickly.
ROM is much more expensive than RAM.
Advantages:
ROM is Non-volatile, requiring no power to keep the content, where RAM is volatile, loosing its content

once power has been removed.
ROM is used for microprogramming (eg: CMOS) where the content is of such a nature that it is fairly static, not requiring to be update.

2b)
No true comparison can be done between RISC and CISC since there are no true RISC and true CISC systems. The CISC systems have incorporated RISC features for performance and the RISC systems have incorporate CISC features. The comparisons have not been done on like for like machines, where the CISC systems would
typically have been toy machines.

2c)
Embedded computers typically serve a specific function where the other categories typically serve a more general type function.
Embedded computers are generally smaller than their counterparts.
Embedded computers are typically used in general house hold appliances (microwave, etc), vehicles, etc.

2d)
((A'BC)' + B'C'winking smiley' + AB
= (A'BC)''(B'C'winking smiley' + AB [...de morgan (x + y)' = x'y'...]
= (A'BC)(B'C'winking smiley' + AB [...double negative x'' = x...]
= (A'BC)(B'' + C''winking smiley + AB [...de morgan...]
= (A'BC)( B ) + (A'BC)(C) + AB [...distributive...]
= A'BBC + A'BCC + AB [...distributive...]
= A'BC + A'BC + AB [...idempotence xx = x...]
= A'BC + AB [...idempotence...]
...and i think this is where it stops ....

...you can do:
= A'BC + (AB + ABC) [...AB = AB + ABC ...]
[...= AB(1 + C) ...]
[...= AB(1) ...]
[...= AB ...]
= A'BC + AB + ABC
... but then i think you get this ...
= A'BC + ABC + AB
= BC(A' + A) + AB [...distributive...]
= BC(1) + AB [...complement x' + x = 1 ; x'x = 0...]
= AB + BC

...if you don't agree, please let me know.

2e
ABC+DE*/+
= A(B+C)DE*/+
= A(B+C)(D*E)/+
= A((B+C)/(D*E))+
= A + (B+C)/(D*E)

2f
The study of assembly language leads to a better understanding of the cpu its internal organization and architecture. Programming in assembly language is generally good for compilers and I/O subroutines. The code is normally more efficient.

2g)
1) Direct
2) Indirect
3) Register Indirect
Re: 2006 Exam Paper
November 04, 2007 07:40PM
Esckay I don't think what you wrote can work, AX will be doubled each time the loop runs.
1d 3)
MOV CX, 8
LOOP1:
ADD AX, AX
LOOP LOOP1

I think it should be

Mov CX,8
xor bx,bx ; zero bx
mov bx,ax ; store ax's value in bx
loop1:
ADD AX,BX
loop loop1
Re: 2006 Exam Paper
November 04, 2007 07:48PM
1g)Moore said the number of transistors that can fit on a chip would double every year and this later slipped to every 18 months.
Re: 2006 Exam Paper
November 04, 2007 07:52PM
Hi T,

... having a look at that again, it looks like you are 100% correct, thanks.

Has anybody done question 3 yet ? I have semi started with it, but it is still a bit of a mess at the moment, haven't done the programming since June ... and now it show eye popping smiley

Please post the code here if you have a working example. I would really appreciate it.

Thanks.
Re: 2006 Exam Paper
November 04, 2007 08:02PM
Number 2 (g) My answers are different on (i) and (ii)
(i) MOV AX,102 immediate addressing
(ii) MOV AX,[201] Direct / displacement addressing
(iii)MOV AX,[si] Indirect Registar Addressing

And if you had Mov ax,bx it would be Registar addressing
Re: 2006 Exam Paper
November 04, 2007 09:34PM
Looking on Wikipedia...

In 1975, Moore altered his projection to a doubling every two years. Despite popular misconception, he is adamant that he did not predict a doubling "every 18 months." However, an Intel colleague had factored in the increasing performance of transistors to conclude that integrated circuits would double in performance every 18 months.[9]
Re: 2006 Exam Paper
November 04, 2007 09:56PM
Please note I have updated & corrected the first post from subsequent posts. I am working on Q3.
Re: 2006 Exam Paper
November 04, 2007 10:04PM
Here is work in progress for Q3
I have got it to read no. into memory, and have also converted it to hex equiv., thinking that e.g. 255(10) = FF(16) = 1111 1111(b). This is stored in ax, but now need to output this value. My thoughts were to save each bit into memory in a separate byte as a string, and then to output this string to the screen. haven't thought of another way. Some help/corrections to code???

org 0x100
bits 16
jmp main

msg1 db 'Enter no. from 1 to 255 : $'
msg2 db 13,10,'No. entered : $' ; Begins with newline
errormsg db 'xxxx xxxx$'

; This is the input buffer
buf:
max db 4
count db 0
data times 4 db ' '

; This is the output buffer
buf_out:
max_out db 8
count_out db 0
data_out times 8 db ' '

display:
mov ah, 9 ; display string
int 21h
ret

input:
mov ah, 0xA ; Input string
int 21h ;
ret

usable:
mov cl,[count]
mov ch,0
mov ax,0 ; clear ax - will hold final value
mov dh,0 ; clear dh
mov si,data
loop1: mov dl,[si] ; dl contains 1st char entered in ASCII e.g. 1 = 31h
sub dl,30h ; convert ascii to hex e.g. 31h to 01h
imul ax,10 ;
add ax,dx ; mov hex value into ax
inc si
loop loop1 ; will loop as many timew as no. of chars entered
ret

;output in binary format
convert: ;

ret

main:
mov dx, msg1 ; prompt for input
call display
mov dx, buf ;
call input

mov al, '$' ; terminate input buffer with '$'
mov bl, [count] ; bl holds how many chars entered
mov bh, 0 ; clear bh
mov [data+bx], al ; data[count] = '$'

mov dx, msg2 ; output "No. entered : "
call display

call usable ; value entered will be in ax as hex value

call convert ; value to convert is in ax

int 20h ; end program
Re: 2006 Exam Paper
November 05, 2007 07:18AM
The idea is to avaluate each bit and convert it to ascii '0' or '1'. The easiest is to do a left shift so the most significant bit ends up in the higher 8 bits, then add 30 hex to convert to ascii and then replace the 'x' in the buffer with a '0' or '1'. I still need to figure out how to leave the space between the 4th and 5th bits.

display_binary: mov dx,ax ;get the total from AX
cmp ah,0 ;is the value > 255?
jne dis_msg ;yes, display xxxx xxxx
mov si,binary_number ;get the address of the buffer
mov cx,08h ;set counter to 8

loop2: shl dx,01h ;shift left 1 bit
add dh,30h ;Convert to ascii '0' or '1'
mov [si],dh ;replace the 'x' with '0' or '1'
mov dh,0h ;clear the bits in DH
inc si ;move to the next character in the buffer
loop loop2 ;loop

dis_msg: mov dx,binary_number
call display
ret
Re: 2006 Exam Paper
November 05, 2007 09:39AM
Thanks Ferdie. It seemed to work fine. For the space, I broke the loop into 2 parts, added the space in manually (20h).

Here is final code...

org 0x100
bits 16
jmp main

msg1 db 'Enter no. from 1 to 255 : $'
msg2 db 13,10,'No. entered in 2 nibbles in binary: $' ; Begins with newline
errormsg db 'xxxx xxxx$'

; This is the input buffer
buf:
max db 4
count db 0
data times 4 db ' '

; This is the output buffer
binary_number:
max_out db 10
count_out db 0
data_out times 9 db ' ','$' ; string terminator charactor

display:
mov ah, 9 ; display string
int 21h
ret

input:
mov ah, 0xA ; Input string
int 21h ;
ret

usable:
mov cl,[count]
mov ch,0
mov ax,0 ; clear ax - will hold final value
mov dh,0 ; clear dh
mov si,data
loop1: mov dl,[si] ; dl contains 1st char entered in ASCII e.g. 1 = 31h
sub dl,30h ; convert ascii to hex e.g. 31h to 01h
imul ax,10 ;
add ax,dx ; mov hex value into ax
inc si
loop loop1 ; will loop as many timew as no. of chars entered
ret

;output in binary format
display_binary:
mov dx,ax ; get the total from AX
cmp ah,0 ; is the value > 255?
jne dis_errormsg ; yes, display xxxx xxxx
mov si,data_out ; get the address of the buffer

mov cx,04h ; set counter to 4 - do first 4 bits
loop2: shl dx,01h ; shift left 1 bit
add dh,30h ; convert to ascii '0' or '1'
mov [si],dh ; replace the 'x' with '0' or '1'
mov dh,0h ; clear the bits in DH
inc si ; move to the next character in the buffer
loop loop2 ; loop

mov dh,20h ; 20h = space character
mov [si],dh ; replace the 'x' with '0' or '1'
mov dh,0h ; clear the bits in DH
inc si ; move to the next character in the buffer

mov cx,04h ; do next 4 bits
loop3: shl dx,01h ; shift left 1 bit
add dh,30h ; convert to ascii '0' or '1'
mov [si],dh ; replace the 'x' with '0' or '1'
mov dh,0h ; clear the bits in DH
inc si ; move to the next character in the buffer
loop loop3 ; loop

mov dx,data_out
call display
ret

dis_errormsg:
mov dx,errormsg
call display
int 20h ; terminate program

main:
mov dx, msg1 ; prompt for input
call display
mov dx, buf ;
call input

mov al, '$' ; terminate input buffer with '$'
mov bl, [count] ; bl holds how many chars entered
mov bh, 0 ; clear bh
mov [data+bx], al ; data[count] = '$'

mov dx, msg2 ; output "No. entered : "
call display

call usable ; value entered will be in ax as hex value

call display_binary ; value to convert is in ax

int 20h ; terminate program
Re: 2006 Exam Paper
November 05, 2007 09:45AM
Thanks for the input guys.
I'm in serious trouble with this module.
Re: 2006 Exam Paper
November 05, 2007 02:40PM
Don't feel lonely Andre !

I think I about 70% there with the theory, and about 50% there with the practical, but the problem is the time !! I doubt if I'll get the programming part figured out within the time constraints and without a PC.

I really hope there is a couple of questions that was covered in the tuts.

But good luck to everyone and thanks for all those that contributed.

Cheers.
Re: 2006 Exam Paper
November 05, 2007 03:50PM
Hey Andre

I'm also having my doubt about tomorrow, I've only managed to study up to assignment 2. So far I've managed to do Q1 of 2006 exam and it dont look so bad (considering 90% of it was covered up to assign 2, heheheh) I agree with esckay, time is a bu99er with this. Make sure what you know, you know. you only need to pass, thats what i'm aiming for...

Good luck to all!
Re: 2006 Exam Paper
November 05, 2007 03:51PM
Me too. Every time I read over my notes, I think, I know this stuff, but actually it is just familiar. Knowing it is being able to recollect it in the exam, which I'm not too confident about. At this point, I think my memory has suffered from permanent errors. I'm relying on DRAM. Given enough time, I might get through the exam, but it is definitely slower, and not permanent!confused smiley
Re: 2006 Exam Paper
November 05, 2007 04:51PM
I've actually considered not attending tomorrow's exam.
Not that I would bow out now, but I just like teasing myself in a situation as seemingly hopeless as this one. I'll probably pull an all nighter pumped up with red bull, and then totally fall apart tomorrow afternoon.
Once again, this is one of those modules that I did really well with in the first 2 assignments, and then never found my way back to it, until now that is. And everything I thought I new just isn't there.

I must thank all of you who have been open enough to constructively contribute to this thread. Your contribution is what is giving me the only hope of getting through tomorrow's exam, even if it is just parrot fashion on some of your answers.
Shaun - I wouldn't worry too much, you seem to be one of the few who knows what is going on.

"Like the sands through an hour glass........" so the hours are dissappearing, all to quickly.

All the best for tomorrow guys.
Anonymous User
Re: 2006 Exam Paper
November 05, 2007 08:36PM
For outputing binary you should have a look at this link:

http://www.xs4all.nl/~smit/asm04001.htm
Re: 2006 Exam Paper
November 05, 2007 09:27PM
To all who posted, shot! Thanks for making my life alot easier. I'm not looking forward to tomorrow, actually bushed sitting here.

Might do an early morning rather than a late night.

PS > how the hang are we suppose to write a program that long without a PC, and with the auntie next to us hawking a loogie every five seconds? smiling smiley

All the best...
Cheers,
Re: 2006 Exam Paper
November 05, 2007 11:10PM
Thanks for the link, ubervan
Anonymous User
Re: 2006 Exam Paper
November 05, 2007 11:16PM
Thanx guys for your contributions, but hey the program difficult to comprehend hot smiley
Re: 2006 Exam Paper
November 06, 2007 03:53AM
Did anyone pick up that Question 2e is incorrect.
Convert the following expression from infix to postfix notation:
ABC+DE*/+

It's already in postfix notation. smile
Re: 2006 Exam Paper
November 06, 2007 05:06AM
AndreB:

I did notice that...the steps given above convert it to a normal formula...

Pretty sure they're gonna ask about CISC vs RISC. gotta brush up on that.

also, 2d) towards the end, you get...
A'BC + AB
will extracting the B make any difference?
=B(A'C + A) in terms of A and A', or does that C get in the way?

Nice tut ubervan thumbs up
thanks.
Re: 2006 Exam Paper
November 06, 2007 05:13AM
Also,

check http://www.wikistudent.ws/unisa/wiki/index.php?title=Computer_organisation
under the study notes section for a course summary. Little late, i know. Will require you to register to download the summaries. Maybe for next year...
Re: 2006 Exam Paper
November 06, 2007 05:47AM
Hi Ryan,
Question 2d is not complete at A'BC + AB.
From this point you go:

A'BC + AB(C + 1) ; NULL C + 1 = 1
A'BC + ABC + AB ; Distribution
BC(A' + A) + AB ; Distribution
BC + AB ; Complement
AB + BC ; Association

The last step isn't really necessary, it just looks neater that way.
If this step of introducing C + 1 is a little confusing, see pg 11 of Tut 501.

I've pretty much given up on the theory, now just trying to get some coding done, but trying to fight of the sleep.
Sorry, only registered users may post in this forum.

Click here to login