Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Realization of the given function
a
b
c
d
f
Minimizing the function
a
c
b
f
3. Simplify the given logic expressions with the given three inputs.
! !
m m
, , , f and , , , , , f 6 5 4 2 7 6 5 2 1 0
2 1
ANSWER
4. Explain the following for Instructions:
A). Data processing
B).Data storage
C). Data movement
D). Control
ANSWER
Data Processing
Data transfer s the most fundamental type of machine instruction. The data transfer must
specify
1 the location of the source and destination each location can be memory, register or top
of stack
2 the length of the data to be transferred
3 The mode of addressing for each operand
If both the operands are CPU registers, then the CPU simply causes data to be transferred from
one register to another. This operation is internal to the CPU. If one or both operands are in
memory, then the CPU must perform some or all of the following actions:
y Calculate the memory address, based on the address mode.
y If the address refers to virtual memory, translate from virtual to actual memory address.
y Determine whether addressed item is in cache.
y If not issue command to memory module.
For example: Move, Store, Load (Fetch), Exchange, Clear (Reset), set, Push, Pop
Arithmetic: Most machines provide basic arithmetic functions like Add, Subtract, Multiply,
Divide. They are invariably provided for signed integer numbers. Often they are also provided
for floating point and packed decimal numbers. Also some operations include only a single
operand like Absolute that takes only absolute value of the operand, Negate that takes the
compliment of the operands, Increment that increments the value of operand by 1, Decrement
that decrements the value of operand by 1.
Logical Machines also provide a variety of operations for manipulating individual bits of a word
Often referred to as bit twiddling. They are based on Boolean operations like AND, OR, NOT,
XOR, Test, Compare, Shift, Rotate, Set control variables.
Data Storage
Computer data storage, often called storage or memory, refers to computer components and
recording media that retain digital data used for computing for some interval of time. Computer
data storage provides one of the core functions of the modern computer, that of information
retention. It is one of the fundamental components of all modern computers, and coupled with a
central processing unit (CPU, a processor), implements the basic computer model used since
the 1940s.
Primary storage (or main memory or internal memory), often referred to simply as memory,
is the only one directly accessible to the CPU. The CPU continuously reads instructions stored
there and executes them as required. Any data actively operated on is also stored there in
uniform manner.
Secondary storage (also known as external memory or auxiliary storage), differs from primary
storage in that it is not directly accessible by the CPU. The computer usually uses its
input/output channels to access secondary storage and transfers the desired data using
intermediate area in primary storage. Secondary storage does not lose the data when the
device is powered downit is non-volatile. Per unit, it is typically also two orders of magnitude
less expensive than primary storage. Consequently, modern computer systems typically have
two orders of magnitude more secondary storage than primary storage and data is kept for a
longer time there.
Tertiary storage or tertiary memory, provides a third level of storage. Typically it involves a
robotic mechanism which will mount (insert) and dismount removable mass storage media into
a storage device according to the system's demands; this data is often copied to secondary
storage before use. It is primarily used for archiving rarely accessed information since it is much
slower than secondary storage (e.g. 560 seconds vs. 1-10 milliseconds). This is primarily
useful for extraordinarily large data stores, accessed without human operators. Typical
examples include tape libraries and optical jukeboxes.
Data Movement
Instructions to copy data and perform arithmetic operations reference two operands. The first
called the "source" (abbreviated as src) describes an operand (a variable) from which data is
only obtained, and the second operand, called the destination (dst or dest) describes a variable
to whom the operation is applied. By default, two-operand instructions operate on words (2-
bytes=16 bits) at a time. This default option can be explicitly specified by a ".w" suffix. To
operate on bytes, a ".b" suffix can be specified instead.
For example,
mov.b &0x1000, &1002 ; move 1 byte from 0x1000 to 0x1002
Is a "byte move" instruction, which implements an assignment operator (=). This instruction
copies one byte from from (source) address 0x1000 to the (destination) address 0x1002. The
ampersand (&) is required.
Control
The control unit is the part of a computer that controls the computer's operation. Basically, each
part of the computer requires control signals to arrive at particular times for each instruction of
the computer's software. The control unit provides those control signals. The control system's
function is as followsnote that this is a simplified description, and some of these steps may be
performed concurrently or in a different order depending on the type of CPU:
1 Read the code for the next instruction from the cell indicated by the program counter.
2 Decode the numerical code for the instruction into a set of commands or signals for each
of the other systems.
3 Increment the program counter so it points to the next instruction.
4 Read whatever data the instruction requires from cells in memory (or perhaps from an
input device). The location of this required data is typically stored within the instruction
code.
5 Provide the necessary data to an ALU or register.
6 If the instruction requires an ALU or specialized hardware to complete, instruct the
hardware to perform the requested operation.
7 Write the result from the ALU back to a memory location or to a register or perhaps an
output device.
8 Jump back to step (1).
5. Explain the Virtual address translation method with neat diagram.
ANSWER
A virtual address translation method based on the concept of fixed length pages is shown in the
figure below. Each virtual address generated by the processor is interpreted as a page number
followed by a word number. Information about the disk or the main memory is kept in a page
table in the main memory.
The starting address of this table is kept in a page table base register. By adding the page
number to the contents of this register, the address of corresponding entry in the page table is
obtained. The content of this location gives the starting address of the page if that page
currently resides in the main memory. Otherwise they indicate the location where the page is to
be found in the secondary storage. In this case the entry in the table usually points to an area in
the main memory where the secondary storage address of the page is held. Each entry also
includes some control bits to describe the status of the page while it is in the main memory.
One control bit indicates whether the page has been modified when it was in the main memory.
If the page table is stored in the main memory unit, then the two main memory accesses must
be made for every main memory access requested by the program. This may result in a
degradation of speed by a factor of two. However a specialized cache memory is used in most
of the systems to speed up the translation process by storing recently used virtual to physical
address translation.
Virtual memory increases the effective size of the main memory. Only the active space of the
virtual address space is mapped onto locations in the physical main memory, whereas the
remaining virtual addresses are mapped onto the bulk storage devices used. During a memory
cycle the addressing spacing mechanism (hardware or software) determines whether the
addressed information is in the physical main memory unit. If it is, the proper information is
accessed and the execution proceeds. If it is not, a contiguous block of words containing the
desired information are transferred from the bulk storage to main memory displacing some block
that is currently inactive.
6. Explain the addition of a two floating point numbers with examples.
ANSWER
The steps (or stages) of a floating-point addition:
1 The exponents of the two floating-point numbers to be added are compared to find the
number with the smallest magnitude
2 The significand of the number with the smaller magnitude is shifted so that the
exponents of the two numbers agree
3 The significands are added
4 The result of the addition is normalized
5 Checks are made to see if any floating-point exceptions occurred during the addition,
such as overflow
6 Rounding occurs
Example: s = x + y
y numbers to be added are x = 1234.00 and y = -567.8
y these are represented in decimal notation with a mantissa (significand) of four digits
y six stages (A - F) are required to complete the addition
Name: SAMUEL TETTEH-NARTEY
Roll Number: .................................................
Learning Centre: 02544
Course & Semester: MScCS SEMESTER 1
Subject: DISCRETE MATHEMATICS
Assignment No.: 1
Subject Code: MC0063
Date of Submission at the Learning Centre: 20
TH
FEBRUARY, 2012
1. If } , , { }, , { }, , , { }, , , , , { e c b C e d B d c a A e d c b a U ! ! ! ! then evaluate the following
a) (AB) v (BC)
b) (BC)dvA
c) (BA)vCd
d) Ad v (BC)
e) (AB)d v (BC)