0% found this document useful (0 votes)
5 views11 pages

A 01 Solution

The assignment for CS2523 at Capital University focuses on computer organization, instruction cycle, and data representation, requiring students to submit handwritten work by October 6, 2024. It includes tasks on defining key concepts, differences between microprocessor types, and conversions between number systems. Strict guidelines emphasize originality, format, and timely submission to avoid penalties.

Uploaded by

Hash Mughal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views11 pages

A 01 Solution

The assignment for CS2523 at Capital University focuses on computer organization, instruction cycle, and data representation, requiring students to submit handwritten work by October 6, 2024. It includes tasks on defining key concepts, differences between microprocessor types, and conversions between number systems. Strict guidelines emphasize originality, format, and timely submission to avoid penalties.

Uploaded by

Hash Mughal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Capital University of Science and Technology

Department of Computer Science


CS2523 – Computer Organization and Assembly Language
ASSIGNMENT NO. 1: Computer Organization, Instruction Cycle, Data
Representation
CLO: 1. Define concepts in the design of microprocessor as state machine and designing its
data path and its controller. [C1- Remembering]
Semester: Fall 24 Max Marks: 10
Instructor: Ms. Tayyaba Zaheer

Assigned Date: September 30, 2024 Due Date: October 06, 2024
Name: Reg. No.
Guidelines:
You are required to submit the screenshots of code and output of the program (where required) and
concepts in your own words i.e., must be hand written in the assignment file (word or pdf – pictures
attached must be readable and in portrait mode) as courseCode_studentReg#_studenName via Portal
(Odoo).
Important Note:
1) Must not copy from other students, so do it all yourself.
2) Assignment should be hand written. Must mention your name and Reg# on each page.
3) No assignment will be accepted after the due date via email in any case (whether it is the case of
load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the
last hour of deadline. It is recommended to upload solution file at least two days before its
closing date.
4) If you find any mistake or confusion in assignment (Question statement), please consult with
your instructor before the deadline. After the deadline no queries will be entertained in this
regard.
Please carefully read the following instructions before attempting assignment.
RULES FOR MARKING:
It should be clear that your assignment would not get any credit if:
• The assignment is submitted after the due date.
• The submitted assignment does not open or file is corrupt.

Strict action will be taken if submitted solution is copied from any other student or from the internet.

You should consult the recommended books to clarify your concepts as handouts are not enough.

You are supposed to submit your assignment in .doc or docx or PDF format.
Any other formats like scan images, zip, rar, ppt and bmp etc. will not be accepted.
Objectives:
After completion of this Assignment, you will have gained basic knowledge of computer
organization and assembly. You will be able to understand different data representation techniques
used in computers.
Data Representation: Topic: Number Systems, and Conversion between Decimal, Binary, Hexadecimal,
and other bases. Related Reading: Class Lectures and Reading Material Shared with the assignment.
Tools/Software Requirement (Optional):
1. Microsoft Word.
Tasks:
Task#1: Computer Organization: (03 marks)

Question#1: What is a Datapath?

Solution:

The component of the processor that performs arithmetic operations.

Question#2: What is an ALU?

Solution:

Hardware that performs addition, subtraction, and usually logical operations such as AND and OR.

Question#3: Which key design element changed in 2005 to drive continued improvements in computing
capability?

Solution:

Multiprocessor architecture - Around 2005, computer architects made a major shift to building multiple
copies of the processor on the same chip; these copies are called cores.

Question#4: Write down the differences between multicore and multiprocessor?

Solution:
Multicore Multiprocessor
A single CPU or processor with two or more A system with two or more CPUs that allows
independent processing units called cores that simultaneous processing of programs.
are capable of reading and executing program
instructions.
Executes a single program faster. Executes multiple programs faster.
Not as reliable as a multiprocessor. More reliable since failure in one CPU will not
affect the other.
Have less traffic. Have more traffic.

Question#5: Write down the differences between microprocessor and microcontroller?

Solution:

Microprocessor Microcontroller
Microprocessor consists of only a Central Micro Controller contains a CPU, Memory, I/O all
Processing Unit. integrated into one chip.
Microprocessor is used in Personal Computers. Micro Controller is used in an embedded system.
Microprocessor uses an external bus to interface Microcontroller uses an internal controlling bus.
to RAM, ROM, and other peripherals.
Microprocessors are based on Von Neumann Micro controllers are based on Harvard
model. architecture.
Microprocessor is complicated and expensive, Microcontroller is inexpensive and
with a large number of instructions to process. straightforward with fewer instructions to
process.
Question#6: Elaborate difference between Registers, Cache, RAM, and Hard Disk in the form of pictorial
representation in terms of access time, amount of storage, and cost per byte?

Solution:

Task#2: Instruction Cycle: (03 marks)


Question: Elaborate 5 sub-operations of the control unit in the given scenario of Instruction Cycle:
Solution:
i. Fetch:
Instruction at memory address 102 would be fetched in IR.
ii. Decode:
Instruction would be decoded on the basis of opcode.
iii. Fetch Operands:
This would not execute for the specified instruction.
iv. Execute:
This sub operation would not execute for the specified instruction.

v. Store:
Value of register R1 i.e., 11 would be stored in memory at location or address 501 in this sub operation.
Task#3: Data Representation: (04 marks)
Question#1: Convert Decimal 25 to binary:
Answer:
Given decimal number is 25.
Divide this number by 2 until the reminder is 0 or 1.
2 | 25
________
2 | 12……………1
________
2 | 6…………….0
________
2 | 3…………….0
________
1…………….1
So, the binary equivalent is,
(25)10 = (11001)2
Question#2: Convert Decimal 451 to octal form:
Answer:
Given decimal number is 451

Start the division process

Start the division process

8 | 451

8 | 56 -- 3

8 | 7 -- 0

8 | 0 -- 7

Correct answer is the equivalent octal number for (451)10 is (7038)8


Question#3: Convert Decimal 146 to hexadecimal:
Answer:

46 is greater than 16 , so we have to divide by 16.

After dividing by 16 , quotient is 9 and remainder is 2.

remainder is less than 16.

the hexadecimal number of remainder is 2.

Quotient is 9 and hexadecimal number of remainder is 2.

so, the 92 is the hexadecimal number is equivalent to decimal number 146.

16 | 146
-------
16 | 9 -- 2
-------
0 -- 9

Correct answer is 92
Question#4: Convert Binary 010111012 to decimal number:
Answer:

Binary number is 01011101.

01011101 = (0 X 27) + (1 X 26) + (0 X 25) + (1 X 24) + (1 X 23) + (1 X 22) + (0 X 21) + (1 X 20)

= (0 X 128) + (1 X 64) + (0 X 32) + (1 X 16) + (1 X 8) + (1 X 4) + (0 X 2) + (1 X 1)


= 0 + 64 + 0 + 16 + 8 + 4 + 0 + 1

Correct answer is 93
Question#5: Convert Binary 10101012 to octal:
Answer:

Given binary number is 10101012

First we convert given binary to decimal

10101012 = (1 * 26) + (0 * 25 ) + (1 * 24) + (0 * 23) + (1 * 22) + (0 * 21) + (1 * 20)

= 64 + 0 + 16 + 0 + 4 + 0 + 1

= 64 + 21

= 85 (Decimal form)

Now we will convert this decimal to octal form

8 | 85

-------
8 | 10 -- 5
-------
8 | 1 -- 2
-------

8 | 0 --1

Correct answer is equivalent octal form is 1258


Question#6: Convert Binary 00010111 in hexadecimal number:
Answer:

The given binary number is 00010111

Now, we convert it first to decimal number

So, 00010111 =

(0 ×27) + (0 × 26) + (0 × 25) + (1 × 24) + (0 × 23) + (1 × 22) + (1 × 21) + (1 × 20)

= (0 ×128) + (0 × 64) + (0 × 32) + (1 × 16) + (0 × 8) + (1 × 4) + (1 × 2) + (1 ×1)

= 0 + 0 + 0 + 16 + 0 + 4 + 2 + 1
= 23 ( It is in decimal from)

Now, we have to change it to hexadecimal number.

So, 23 is greater than 16, so we have to divide it by 16.

After dividing by 16 , quotient is 1 and remainder is 7.

Remainder is less than 16.

The hexadecimal number of remainder is 7.

Quotient is 1 and hexadecimal number of remainder is 7.

That is, 23 = 16 × 1 + 7

1 = 16 × 0 + 1

So, 17 is the hexadecimal number is equivalent to decimal number 23.


Question#7: Convert Octal 57468 to decimal:
Answer:
The given number is 57468

57468 = (5 * 83)+ (7 * 82) + (4 * 81) + (6 * 80)

=5 * 512 + 7 * 64 + 4 * 8 + 6 * 1

= 2560+448+32+6

= 3046

The equivalent decimal number for 57468 is 3046

57468 = 3046

Question#8: Convert Octal 278 to a binary number:


Answer:
Given number is 278

278 = (2 * 81) + (7 * 80)

=2*8+7*1

= 16 + 7

= 23(Decimal number)
Now convert this decimal number to a binary number.

2 | 23
2 | 11 -- 1
2 | 5 -- 1
2 | 2 --1
2 | 1 -- 0
2 | 0 -- 1

The binary number is 101112

278 = 101112
Question#9: Convert Octal 10028 to hexadecimal:
Answer:
The given number is 10028

10028 = (1 * 83)+ (0 * 82) + (0 * 81) + (2 * 80)

=1 * 512 + 0 * 64 + 0 * 8 + 2 * 1

= 512 + 0 + 0+ 2

= 514(decimal number)

Now we convert the above decimal to hexadecimal

16 | 514
16 | 32 --2
2 -- 0

The hexadecimal number is 202

10028 = 20216
Question#10: Convert Hexadecimal CA16 to decimal:
Answer:
Given hexadecimal number is CA16.

CA16
= 161 × C + 160 ×A

= 16 ×C + 1 ×A

= 16 ×C + A

= 16 ×12 +9

= 192 + 9
= 202

Answer is 202.
Question#11: Convert Hexadecimal A2B16 to binary:
Answer:
Given hexadecimal number is A2B

A2B16 = (A * 162) + (2 * 161) + (B * 160)


= (A * 256) + (2 * 16) + (B * 1)

= (10 *256) + 32 + 11

= 2560 + 43

= 2603(Decimal number)

Now we have to convert 2603 to binary

2 | 2603
2 |1301 -- 1
2 | 650 -- 1
2 | 325 -- 0
2 | 162 -- 1
2 | 81 -- 0
2 | 40 -- 1
2 | 20 -- 0
2 | 10 -- 0
2 | 5 -- 0
2 | 2 -- 1
2 | 1 -- 0
2 | 0 -- 1

The binary number is 1010001010112

A2B16 = 1010001010112
Question#12: Convert Hexadecimal 10516 to octal:
Answer:
Given hexadecimal number is 105

10516 = (1 * 162) + (0 * 161) + (5 * 160)

= 1*256 + 0 * 16 + 5 * 1

=256 + 0 +5

= 261(Decimal form)
Now we have to convert this decimal to octal

8 | 261
8 | 32 -- 5
8 | 4 -- 0
8 | 0 --4

The octal number is 4058

10516 = 4058

You might also like