In: Computer Science
Problem A.
A part of the code has been given below:
ldd $4000
ldx $4002
idivs
stx $4005
std $4008
What does this code do? Include specific comments on each line
of the code.
State the addressing mode of each instruction above.
Problem 2.
What does the following program doing. Rewrite the code and insert the comment field
org $2000
ldaa $1500
adda
stx $4005
std $4008
Problem 3.
Convert the following numbers to decimal:
(a) 1001002 =
(b) 2 B91 =
Problem 4.
Convert the following numbers to Hexadecimal:
a. 1 2310 =
b. 10000012
Problem 6.
Write a procedure, assembly code, that clears the memory locations
of $1000, $1001 and $1002 and transfer the values of memory
location $1008, $1009, and $1010 onto them in respective
order.
Problem 7.
• How many address lines are needed to
address each memory location in a 2048 x 4 memory chip?
a. 10
b. 11
c. 8
d. 12
2. The octal equivalence of 111010
is
a. 81
b. 72
c. 71
d. None of above
• The most commonly used standard data
code to represent alphabetical, numerical and punctuation
characters used in electronic data processing system is
called
a. ASCII
b. EBCDIC
c. BCD
d. All of above
• The Width of a processor’s data path
is measured in bits. Which of the following is not a common data
path width? State the reason in a sentence
a. 8 bits
b. 12 bits
c. 16 bits
d. 32 bits
• The word length of a computer is
measured in
a. Bytes
b. Millimeters
c. Meters
d. Bits
• The left side of any binary number is
called:
a. Least significant digit
b. Most significant digit
c. Medium significant digit
d. low significant digit
• A nibble can be represented in the form
of:
a.
Octal digit
b.
Decimal
c.
Hexadecimal
d.
None of these
Problem 8.
Explain the following sets of instructions and what will be the
outcome?
org $2000;
Ldd $1502;
Subd $1506;
Std $1501;
Ldaa $1501;
Sbca $1505;
Staa $1511;
Ldaa $1500;
Sbca $1504;
Staa $1510;
End
Problem 9.
Write a program to add numbers stored in memory locations $ 2000,
$2001, $2002 and save the result in memo $2010.
Problem 10.
Write a program to subtract the contents of the memory locations at
$1005 from the sum of the memory locations at $1000 and $1002, and
store the difference at $1010. Then, show the flow chart of the
program ( include the comments).
Problem 7:option b
11 address lines are needed to address each machine location in a 2048 X 4 memory chip.
It means that a memory of 2048 words, where each word is 4 bits. So to address 2048 (or 2K, where K means 2^10 or 1024), you need 11 bits, so 11 address lines. To express in very easy terms, without any bus-multiplexing, the number of bits required to address a memory is the number of lines (address or data) required to access that memory. Quoting from the Wikipedia article, a system with a 32-bit address bus can address 232 (4,294,967,296) memory locations.
* Option b
The octal equivalence of 111010 is 72.
The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Octal numerals can be made from binary numerals by grouping consecutive binary digits into groups of three (starting from the right).
It comes from the Latin word for eight. The octal numbering system uses the numerals 0-1-2-3-4-5-6-7. In computing environments, it is commonly used as a shorter representation of binary numbers by grouping binary digits into threes. The chmod command in Linux or UNIX uses octal to assign file permissions.
Binary and Octal. In 1679, Gottfried Leibniz invented the binary numeral system, and published the first information about it in his article "
* Option a
8 bits....
*option a
ASCII....
* Option d
Word length in computer measured in bits...
*Option b
Most significant digit
* Option c
Hexadecimal