Education In Pakistan

Papers, Notes, Books & Help For Students

UPDATED EDUCATIONAL NEWS INTERVIEW HELP FOR ALL JOBS ONLINE BOOKS SCHOLARSHIPS AVAILABLE INTERNSHIP JOBS

Tag: Fall 2012

VU CS610- Computer Network FinalTerm solved unsolved past papers Fall 2012

VU CS610- Computer Network FinalTerm Solved Unsolved Past Papers Fall 2012

 

 

 

 

CS610- Computer Network

Solved Subjective                              June 23,2012

 

CS610 Current Final Term Papers

Fall 2012

 

Q: differentiate between IP and transport protocol with the help of example.             (2 Marks)

Answer: – (Page 119)

1-IP provides computer-to-computer communication while TP provide application-to-application communication.

2-IP source and destination addresses are computers while TP need extended addressing mechanisms to identify applications

3-IP is also called machine-to-machine communication while TP are called end-to-end communication.

 

Q: Give the main advantage and disadvantage of RIP.            (2 Marks)

Answer: – click here for detail

The biggest advantage of RIP is that it is simple to configure and deploy.

The biggest disadvantage of RIP is its inability to scale to large or very large networks. The maximum hop count used by RIP routers is 15.Another disadvantage of RIP is its high recovery time.

 

Q: Tel the first assignable IP address from a 128.140.80.24/20.            (2 Marks)

Answer: – Click here for detail

The host address range for this subnet is 128.140.80.1 – 128.140.95.254, so the first assignable IP address is 128.140.80.1.

Q: how was the NAT implemented?           (2 Marks)

Answer: – (Page 130)

We can see that the old and new values of IP source field and destination field are shown with their directions.

 

 

 

 

 

NAT device stores state information in table. The value is entered in the table when NAT box receives outgoing datagram from new.

 

 

1

 

 

 

 

 

Q: IS ATM including LAN and WAN network. If yes what kind of connection is established?   (2 Marks)

Answer: – (Page 66)

Yes it includes LAN and WAN network and established connection-oriented connection.

 

 

Q: is IP multicasting beneficial? Defend your answer with proper reason.            (3 Marks)

Answer: – Click here for detail

We assume that IP multicast is more beneficial for the channels with a high popularity, and therefore these
channels will be preferred when the number of available multicast groups is smaller than the number of
channels.

Q: Can the length of the segment be increased 500 meter by adding three repeater one with each

segment. It can be done or not.            (3 Marks)

Answer: (Page 49)

One repeater doubles, two repeaters triple the maximum cable length limitation. It is to be noted that we cannot

increase the maximum cable length as many times as we wish by just adding repeaters.

 

Q: How an administrator can handle static and dynamic routing.             (3 Marks)

Answer: – Click here for detail

Routing can be handled by a static routing table built by the system administrator. Static tables do not

dynamically adjust to changing network conditions, so each change in the table is made manually by the network administrator.

Routing can be handled by a dynamic routing table that responds to changing network condition. Dynamic routing tables are built by routing protocols.

 

Q: IS TCP/IP suit including ARP. What kind of messages are in ARP.            (3 Marks)

Answer: – (Page 97)

The TCP/IP protocol suite includes an Address Resolution Protocol (ARP). The ARP standard defines two basic message types:

• Request

• Response

 

Q: Traceroute continues to increment the Time To Live until the value is large enough for the datagram
to reach its final destination. What happens when the TTL is sufficiently large for the datagram to reach

its destination?            (3 Marks)

Answer: – Click here for detail

To learn when a datagram reaches its destination, traceroute sets the UDP destination port number in the

datagram to a very large value that the destination host is unlikely to be using. When a host receives a datagram destined to it containing a destination port number that is unused locally, it sends an ICMP port-unreachable
error to the source.

 

 

2

 

 

 

 

 

Q: describe characteristics of BGP.            (5 Marks)

Answer: – (Page 138)

It is most popular Exterior Gateway Protocol in Internet. It has following characteristics:

“It provides routing among autonomous systems (EGP). “It provides policies to control routes advertised.
“It uses reliable transport (TCP).

“It gives path of autonomous systems for each destination. “Currently the EGP is of choice in the Internet.
“The current version is four (BGP-4).
“It provides facilities for Transit Routing.

Q: describe IPV6 addressing notation.            (5 Marks)

Answer: – (Page 114)

 

128-bit addresses unwisely in dotted decimal; requires 16 numbers: 105.220.136.100.255.255.255.255.0.0.18.128.140.10.255.255

 

Groups of 16-bit numbers in hex separated by colons – colon hexadecimal (or colon hex). 69DC: 8864:FFFF: FFFF: 0:1280:8C0A:FFFF

Zero-compression – series of zeroes indicated by two colons FF0C: 0:0:0:0:0:0:B1

FF0C::B1

 

IPv6 address with 96 leading zeros is interpreted to hold an IPv4 address.

 

Q have there is a technique for achieving reliability through TCP.            (5 Marks)

Answer: – (Page 123)

Reliability is the responsibility of the Transport layer. In TCP/IP, TCP provides reliable transport service. Most Internet applications use TCP as no other protocol has proved to work better.

SERVICE PROVIDED BY TCP:

Following are the services provided by TCP:

• Connection-oriented service

• Point-to-point

• Complete reliability

• Full-duplex communication

• Stream interface

• Reliable connection startup

• Graceful connection shutdown

 

 

3

 

 

 

 

CS610 Current Final Term Papers

Fall 2012

 

Is there any technique for achieving reliability through TCP?            (5 Marks)

Answer: – rep

2. Give reasons for which IPv4 need to be changed?           (5 Marks)

Answer:-   (Page 110)

One of the parameters, which motivated IP for change, is address space. The 32-bit address space allows for over a million networks.

 

But most networks are class C and too small for many organizations. 214 class B network addresses already almost exhausted (and exhaustion was first predicted to occur, a couple of years ago).

 

The second parameter is type of service, the IP provides. Different applications have different requirements for delivery reliability and speed. Current IP has type of service that is not often implemented. Another factor for the motivation for change is multicast.

3. In a star organization there are 120 systems connected in a network. Give your comments about delay;

delay should be smaller or larger. Give reasons?            (5 Marks)

4. How TCP provides reliability?            (3 Marks)

Answer: – (Page 125)

TCP achieves reliability by retransmission. An acknowledgement is used to verify that data has arrived successfully. If acknowledgement does not arrive, the previous data is retransmitted.

5. How TCP and IP interact with each other?           (3 Marks)

Answer: – (Page 123)

TCP uses IP to carry messages. TCP message is encapsulated in IP datagram and sent to the destination. On the

destination host, IP passes the contents to TCP. It is shown in the figure below.

 

 

6. Describe four factors for network classification?            (2 Marks)

Answer: – (Page 4)

Computer networks are classified by four factors which are as follow:

1) BY SIZE:

2) BY CONNECTIVITY:

3) BY MEDIUM:

4) BY MOBILITY:

 

 

 

 

4

 

 

 

 

CS610 Current Final Term Papers

Fall 2012

 

Q1- What is ICMP and what type of errors internet layer can detect?            (5 Marks)

Answer: – (Page115)

Internet control Message Protocol (ICMP) defines error and informational messages. These are given as follows:

1. ERROR MESSAGES:

These are as follows:

• Source quench

• Time exceeded

• Destination unreachable

• Redirect

• Fragmentation required

 

Q2- In which situation RIP support for default routers?            (5 Marks)

Q3- Give Pros and Cons of static and Dynamic routing.            (5 Marks)

Answer: –  Click here for detail

Pros and Cons of Static Routing

v  Static routing is not really a routing protocol. Static routing is simply the process of manually entering
routes into a device’s routing table via a configuration file that is loaded when the routing device starts
up.

v  Static routing is the simplest form of routing, but it is a manual process.

v  Use static routing when you have very few devices to configure (<5) and when you know the routes will
probably never change.

v  Static routing also does not handle failures in external networks well because any route that is

configured manually must be updated or reconfigured manually to fix or repair any lost connectivity.

 

 

Pros and Cons of Dynamic Routing

v  Dynamic routing protocols are supported by software applications running on the routing device (the
router) which dynamically learn network destinations and how to get to them and also advertise those
destinations to other routers.

v  A router using dynamic routing will ‘learn’ the routes to all networks that are directly connected to the
device.

v  Next, the router will learn routes from other routers that run the same routing protocol (RIP, RIP2,
EIGRP, OSPF, IS-IS, BGP etc). Each router will then sort through it’s list of routes and select one or
more ‘best’ routes for each network destination the router knows or has learned.
v  Dynamic routing protocols have the ability to adapt to logical network topology changes, equipment
failures or network outages ‘on the fly’.

 

 

5

 

 

 

 

 

Q4- How ICMP used to test different tools?            (3 Marks)

Answer:- (Page 117)

ICMP can also be used to test different tools. An Internet host A, is reachable from another host B, if datagrams can be delivered from A to B. Ping program tests reach ability. It sends datagram from B to A that echoes back to B. it uses ICMP echo request and echo reply messages. Internet layer includes code to reply to incoming
ICMP echo request messages.

Q5 – How does host join and leave a group?            (3 Marks)

Answer: –   (Page 142)

A standard protocol exists that allows a host to inform a nearby router whenever the host needs to join or leave a particular multicast group known as Internet Group Multicast Protocol (IGMP). The computer uses IGMP to inform the local router about the last application when it leaves.

 

Q6- When packet lost what is the procedure TCP adopt?            (3 Marks)

Answer: –  Click here for detail

When a retransmitted TCP packet is lost (i.e., retransmission fails) most implementations do not have a

mechanism to recover the packet without waiting for a retransmission time out and subsequent Slow Start. packet is lost for any reason, TCP adopts a sliding window approach, that is the sender keeps sending a few other packets even if it has not received the ACK for

the missing packet, in case the lost packet will arrive out of order

 

Q7- In this subnet blocks 192.168.1.0/26 What is the range of assignable host address?             (3 Marks)

Q8 – Write the difference between Explicit and implicit frame type.            (3 Marks)

Answer: –   (Page 35)

In EXPLICIT FRAME TYPE the identifying value is included with frame describes types of included data

while in implicit frame the receiver must infer from frame data.

 

Q9 – Give the concept of zero compression regarding IPV6.            (2 Marks)

Answer: –   (Page 114)

Zero-compression – series of zeroes indicated by two colons

FF0C: 0:0:0:0:0:0:B1

FF0C::B1

 

Q10 – Which technique is used for insertion and deletion in routing table.             (2 Marks)

Answer: –

The search, insertion, and deletion operations can be finished in O(log N) time, where N is the number of

prefixes in a routing table.

 

Q11- Can multiple IP addresses assigned or not on different interfaces of a router.            (2 Marks)

Answer: –  Click here for detail

You cannot have two different IP addresses from the same network assigned to the router.

 

 

6

 

 

 

 

 

Q12- In which process backward compatibility of 100-base- T is done?            (2 Marks)

Answer: (Page 47)

100Base-T technology is backward compatible and allows the participants to negotiate a speed when connection is established. This process is known as auto negotiation

Q13- Does OSPF only share information with an area or does it allow communication between different

areas?           (2 Marks)

Answer:- (Page 141)

OSPF allows subdivision of Autonomous System into areas. The link-status information is propagated within an area. The routes are summarized before being propagated to another area.

 

 

 

CS610 Current Final Term Papers

Fall 2012

 

What is the role of area in open shortest path first (OSPF)?               (5 Marks)

Answer:- (Page 141)

OSPF allows subdivision of Autonomous System into areas. The link-status information is propagated within an area. The routes are summarized before being propagated to another area. It reduces overhead (less
broadcast traffic). Because it allows a manager to partition the routers and networks in an autonomous system into multiple areas, OSPF can scale to handle a larger number of routers than other IGPs.

 

 

 

Compare IPv6 with IPv4.           (5 Marks)

Answer: click here for detail

IPV4

32 bits long (4 bytes).

Unicast, multicast, and broadcast.

You must configure a newly installed system before it can communicate with other systems Variable length of 20-60 bytes, depending on IP options present.

iSeries Navigator provides a complete

configuration solution for TCP/IP.

RIP is a routing protocol supported by the routed daemon.

 

 

 

 

IPV6

128 bits long (16 bytes)

Unicast, multicast, and anycast.

Configuration is optional, depending on functions required.

Fixed length of 40 bytes. There are no IP header options

Same for IPV6

 

Currently, RIP does not support IPv6. IPv6 routing uses static routes.

 

 

 

7

 

 

 

 

 

Transit routing.            (3 Marks)

Answer:  Click here for detail

A routing transit number (RTN) is a nine digit bank code, This code was designed to facilitate the sorting, bundling, and shipment of paper checks back to the drawer’s (check writer’s) account.

 

Are TCP/IP protocols organized into conceptual layers?

 

eptual layers.

 

 

 

 

 

 

 

 

 

What is the size of the datagram header?            (3 Marks)

Answer: (Page 102)

Datagram’s can have different sizes i.e.

Header area is usually fixed (20 octets) but can have options. Data area can contain between 1 octet and 65.535 octets (216-1). Usually, data area is much larger than header

 

 

 

 

Can the length of an Ethernet be increased by adding a repeater?            (3 Marks)

Answer: (Page 49)

One repeater doubles, two repeaters triple the maximum cable length limitation. It is to be noted that we cannot increase the maximum cable length as many times as we wish by just adding repeaters.

 

What is meant by client and server?            (2 Marks)

Answer:- (Page 145)

It is used by all network applications. The passive program is called a server and the active program is called a
client.

 

Zero comparison regarding IPv6.            (2 Marks)

Answer:- rep

 

 

 

8

 

 

 

 

Cs610 current Final Term Paper

2012

 

1) Is bridge is intelligent?            (2 Marks)

Answer:-

Yes, bridge is intelligent.

 

2) What is meant by Zero Compression in IPv6?            (2 Marks)

Answer:- (Page 114)

Zero-compression – series of zeroes indicated by two colons FF0C: 0:0:0:0:0:0:B1

FF0C::B1

IPv6 address with 96 leading zeros is interpreted to hold an IPv4 address.

 

3) Why three-way handshake technique is used by TCP?           (3 Marks)

Answer:- (Page 127)

Part of the 3-way handshake used to create a connection, requires each end to generate a random 32-bit

sequence number. If an application attempts to establish a new TCP connection after a computer reboots, TCP

chooses a new random number.

 

4) IS TCP/IP suit include ARP. What kind of messages are in ARP.           (3 Marks)

Answer:- rep

5) Traceroute continues to increment the Time To Live until the value is large enough for the datagram to reach its final destination. What happens when the TTL is sufficiently large for the datagram to reach its destination? 3 marks

Answer:-    rep

6) Why we need server?           (3 Marks)

Answer:- (Page 146)

v  “It can handle multiple remote clients simultaneously. v  “It invoked automatically when system boots.
v  “It executes forever.

v  “It needs powerful computer and operating system. v  “It waits for client contact.

v  “It accepts requests from arbitrary clients.

 

7) Difference b/w PIM-SM and PIM-DM            (5 Marks)

Answer:- (Page 144)

PROTOCOL INDEPENDENT MULTICAST_ SPARSE MODE (PIM-SM):

This is a protocol that uses the same approach as CBT to form a multicast routing tree. The designers chose the
term protocol independent to emphasize that although unicast datagrams are used to contact remote destinations
when establishing multicast forwarding. PIM-SM does not depend on any particular unicast routing protocol.

9

 

 

 

 

PROTOCOL INDEPENDENT MULTICAST _ DENSE MODE (PIM-DM):

A protocol designed for use within an organization. Routers that use PIM-DM broadcast (i.e. flood) multicast packets to all locations within the organization. Each router that has no member of a particular group sends
back a message to prune the multicast routing tree ((i.e., a request to stop the flow of packets). The scheme
works well for short-lived multicast sessions (e.g., a few minutes) because it does not require setup before
transmission begins.

 

8) Describe NAT using at Home.            (5 Marks)

Answer:- (Page 132)

NAT is useful at a residence with Cable Modem or DSL connectivity as it allows the customer to have multiple computers at home without requiring an IP address for each of them. Instead a single IP address is used for all
the computers. NAT software allows a PC to connect with the Internet and act as a NAT device at the same
time. It is shown in the figure below where multiple computers are connected to the dedicated hardware device implementing NAT.

CS610 Current Final Term Papers Fall 2011

 

Why EGP not use routing metric??(5)

Answer:- Click here for detail

Although EGP is a dynamic routing protocol, it uses a very simple design. It does not use metrics and therefore
cannot make true intelligent routing decisions. EGP routing updates contain network reachability information.
In other words, they specify that certain networks are reachable through certain routers. Because of its
limitations with regard to today’s complex internetworks, EGP is being phased out in favor of routing protocols
such as BGP.

 

how congestion control by tcp?(5)

Answer:-  Click here for detail

When a TCP connection first begins, the Slow Start algorithm initializes a congestion window to one segment, which is the maximum segment size (MSS) initialized by the receiver during the connection establishment phase. When acknowledgements are returned by the receiver, the congestion window increases by one segment for each acknowledgement returned. Thus, the sender can transmit the minimum of the congestion window and the advertised window of the receiver, which is simply called the transmission window.

IPv6 addressing (5)

Answer:- (Page 114)

IPv6 uses 128-bit addresses. A 128-bit address includes network prefix and host suffix. An advantage of IPv6 addressing is that it has no address classes i.e. prefix/suffix boundary can fall anywhere.
Following are special types of addresses, IPv6 uses:

Unicast: It is used for single destination computer.

Multicast: It is used for multiple destinations; possibly not at same site.

Cluster: This type of address is used for collection of computers with same prefix; datagram is delivered to one out of cluster.

 

10

 

 

 

 

define jitter (2)

Answer:- (Page 66)

Jitter is the term used for variance in transmission delays.

Jitter is significance for voice, video and data. In LANs, jitter can occur when a packet is delayed because the network is busy.

 

define TCP(2)

Answer:-

TCP (Transmission Control Protocol) is a set of rules (protocol) used along with the Internet Protocol (IP) to send data in the form of message units between computers over the Internet.

what is meant by the client server paradigm ?(2)

Answer:- (Page 145)

It is used by all network applications. The passive program is called a server and the active program is called a
client.

how receiver knows incoming frame is id datagram (2)

Answer:

The sender and receiver must agree on the value used in the frame type field of the frame header in order to know the incoming frame contains an IP datagram.

transit routing (3)

Answer:- rep

why organization does not use single router(3)

Answer: (Page 82)

Organization seldom uses a single router to connect its entire network for two reasons.

• Because the router must forward each packet, the processor in a given router is insufficient to handle the traffic.

• Redundancy improved Internet reliability.

 

if there is no signal, how sever come to know there is communication arrived(3)

 

 

 

CS610 Current Final Term Papers

Fall 2011

 

 

Write a note on IPV6 Addressing.                   (5 Marks)

Answer:- rep

 

 

11

 

 

 

 

 

What are the characteristics of UDP                     (5 Marks)

Answer:- (Page 120)

• It is an end-to-end protocol. It provides application-to-application communication.

• It provides connectionless service.

• It is a Message-Oriented protocol.

• It uses best-effort delivery service.

• It follows arbitrary interaction.

• It is operating system independent

 

What are multicast routing protocols? Give names of 5 of them.                        (5 Marks)

Answer:- (Page 145)

Several multicast protocols exist. Some of the proposed protocols are:

v  DISTANCE VECTOR MULTICAST ROUTING PROTOCOL (DVMRP): v  CORE BASED TREES (CBT):

v  PROTOCOL INDEPENDENT MULTICAST_ SPARSE MODE (PIM-SM):

v  PROTOCOL INDEPENDENT MULTICAST _ DENSE MODE (PIM-DM):

v  MULTICAST EXTENSIONS TO THE OPEN SHORTEST PATH FIRST PROTOCOL (MOSPF): v  CLIENT-SERVER INTERACTION:

 

CS610 Current Final Term Papers

Fall 2011

 

 

Distance Vector Routing            (2 Marks)

Answer:- (Page 63)

Local information is next hop routing table and distance from each switch. The switches periodically broadcast topology information i.e. destination, distance. Other switches update routing table based on received
information.

 

what stand for MTU, define            (2 Marks)

Answer:- (Page 107)

Every hardware technology specification includes the definition of the maximum size of the frame data area, which is called the Maximum Transmission Unit (MTU).

 

why the Internet Multicast Routing is difficult             (2 Marks)

Answer:- (Page 142)

Internet multicast routing is difficult because internet multicast allows arbitrary computer to join multicast group at any time. It allows arbitrary member to leave multicast group at any time.

 

 

12

 

 

 

 

 

What the basic function of Twice NAT?           (2 Marks)

Answer:- (Page 131)

Twice NAT is another variant of NAT. it is used with site that runs server. In this process NAT box is connected to Domain Name.

 

Difference between Static and Dynamic Routing            (3 Marks)

Answer:- (Page 133)

STATIC ROUTING:

It is one of the forms of Internet routing. In Static routing, the table is initialized when system boots and there is no further changes.

DYNAMIC ROUTING:

In dynamic routing the table is initialized when system boots. It includes routing software which learns routes and updates table. In this way continuous changes are possible due to routing software.

 

How a receiver know that incoming data is datagram or other             (3 Marks)

Answer:- rep

what is data stuffing            (3 Marks)

Answer:- (Page 17)

In general to distinguish between data being sent and control information such as frame delimiters network

systems arrange for the sending side to change the data slightly before it is sent because systems usually insert data or bytes to change data for transmission, the technique is known as Data Stuffing.

 

Message Oriented in UDP             (5 Marks)

Answer:- (Page 120)

UDP offers application programs a Message-Oriented Interface. It does not divide messages into packets for transmission and does not combine messages for delivery.

Let’s discuss its advantages and disadvantages.

ADVANTAGES:

• Applications can depend on protocol to preserve data boundaries.

DISADVANTAGES:

• Each UDP message must fit into a single IP datagram.

• It can result to an inefficient use of the underlying network.

 

 

 

 

 

 

 

13

 

 

 

 

CS610 Current Final Term Papers

Fall 2011

 

There are so many multicast protocol, Name only five one of those?            (5 Marks)

Answer:- rep

What is Base Header in IPv6?            (5 Marks)

Answer:- (Page 112)

Base header is fixed size i.e. 40 octets. NEXT HEADER field in the base header defines type of header and it appears at end of fixed-size base header. Some extension headers are variable sized. NEXT HEADER field in extension header defines type.

 

What is simple duplex and full duplex?            (2 Marks)

Answer:- (Page 76)

Some connection-oriented technologies provide full duplex while other allow on simplex connection. To

communicate using a simplex design a pair of computers must establish two connections one from computer A to computer B and another from computer B to A.

What is means by “It provides facilities for Transit Routing.”?            (2 Marks)

Answer:-    Click here for Detail

Facilities For Transit Routing

classifies each AS as a transit system if it agrees to pass traffic through, or as a stub system if it does not BGP allows a corporation to classify itself as a stub even if it is multi-homed (refuse to accept transit traffic)

 

Does OSPF support for multi access network?            (2 Marks)

Answer:- (Page 140)

Yes, OSPF supports for multi access network.

 

What is difference in NIC and CPU Processing?           (3 Marks)

Answer:- (Page 40)

NIC contains sufficient hardware to process data independent of system CPU. In which some NICs contain separate microprocessor. In addition to this it also include analog circuitry interface to system bus, buffering and processing.

What is Extension Header in Ipv6?            (3 Marks)

Answer:- (Page 111)

Additional information is stored in optional extension headers, followed by data.

 

How long TCP Should wait before retransmitting?            (3 Marks)

Answer:- (Page 125)

The time for acknowledgement to arrive depends on:

• Distance to destination

• Current traffic conditions

14

 

 

 

 

Multiple connections can be opened simultaneously. Traffic conditions change rapidly.

 

What is congestion control, How TCP Segment format is done?            (3 Marks)

Answer: (Page 128)

Congestion control

The goal of congestion control is to avoid adding retransmissions to an already congested network. Reducing
the window size quickly in response to the lost messages does it. It is assumed that loss is due to congestion.

TCP Segment format

TCP uses single format for all messages. TCP uses the term segment to refer to a message. Each message sent
from TCP on one machine to TCP on another machine uses this format including data and acknowledgement.

 

 

CS610 Current Final Term Papers

Fall 2011

 

 

 

Question no. 31             (2 Marks)

Find the class in 00000001.001011.1001.111

Answer:   (Page 87)

Class A

 

Question no. 32             (2 Marks)

What is the difference between unicast and multicast?

Answer:-   (Page 114)

Unicast is used for single destination computer while multicast is used for multiple destinations

 

Question no. 33             (2 Marks)

What is the basic concept of Twice NAT (Network Address Translation)?

Answer:-  rep

 

Question no. 34             (2 Marks)

What is the role of DMA in NIC?

Answer:-   (Page 34)

It may use DMA to copy frame data directly from main memory and copy data directly into main memory.

 

Question no. 35             (2 Marks)

What is the function of Hope count matrix in routing information protocol?

Answer:-  Click here for detail

RIP uses a hop count metric to measure the distance to a destination

 

 

15

 

 

 

 

 

Question no. 36 (Marks2)

What is the scale or level of requirement in of IPv6?

Answer:- (Page 110)

Scale is also dramatically changed. Size from a few tens to a few tens of millions of computers has been

revolutionized. Speed has increased from 56Kbps to 1Gbps. Also there is an increased frame size in hardware.

 

Question No: 37            (3 Marks)

Change the following into equivalent binary
154.31.161.13

202.32.15.7
192.168.1.5

154.31.161.13

Answer:

Binary: 10011010 00011111 10100001 00001101

 

202.32.15.7

Answer:

Binary: 11001010 00100000 00001111 00000111

 

192.168.1.5

Answer:

Binary: 11000000 10101000 00000001 00000101

 

 

Question No: 38            (3 Marks)

What is the meaning of Facilities for Transit Routing as a characteristic of the Border Gateway Protocol?

Answer:-    Click here for Detail

Facilities For Transit Routing

classifies each AS as a transit system if it agrees to pass traffic through, or as a stub system if it does not BGP allows a corporation to classify itself as a stub even if it is multi-homed (refuse to accept transit traffic)

 

Question No: 39            (3 Marks)

In internet routing how does a host join or leave a group?

Answer:- rep

 

Question No: 40            (3 Marks)

Name the six services provided by TCP

Answer:- (Page 123)

Following are the services provided by TCP:

• Connection-oriented service

• Point-to-point

• Complete reliability

16

 

 

 

 

• Full-duplex communication

• Stream interface

• Reliable connection startup

• Graceful connection shutdown

 

Question No: 41            (3 Marks)

In internet routing how does a host join or leave a group?

Answer:- rep

 

Question No: 42            (3 Marks)

What are the distance limitations in Fiber Optic?

Answer: Page 48

Optical fiber can extend across several kilometers because delays on optical fiber are very low and bandwidth is very high.

Question No: 43            (5 Marks)

What are the three approaches for datagram forwarding?

Answer:- (Page 143)

FLOOD-AND-PRUNE

CONFIGURATION-AND-TUNNELING
CORE-BASED DISCOVERY

 

Question No: 45            (5 Marks)

Write down the comparison of Distance- vector and Link – state algorithm?

Answer: Page 64

 

COMPARISON:

DISTANCE-VECTOR ROUTING:

• It is very simple to implement.

• Packet switch updates its own routing table first.

• It is used in RIP.

LINK-STATE ALGORITHM:

• It is much more complex.

• Switches perform independent computations.

• It is used in OSPF.

 

 

CS610 Current Final Term Papers

Fall 2011

 

Define simplex and full duplex connection?            (2 Marks)

Answer:- rep

 

17

 

 

 

 

What are the functions that the IP multicast abstraction allows an application running on an arbitrary

computer to do?           (2 Marks)

Answer:   (Page 142)

It also allows arbitrary computer to send message to a group (even if not a member).

 

Give the address 130.4.102.1/24, find the number of subnet bits?            (2 Marks)

What is the functionality of address resolution software in layering?            (2 Marks)

Answer:- (Page 100)

Address resolution software hides ugly details and allows generality in upper layers.

 

Why we need the variants of NAT? Explain it with the proper reasons?            (2 Marks)

Answer:- (Page 131)

Variants of NAT

The basic NAT simply changes IP addresses. But Network Address and Port

Translation (NAPT) (which is another modified form of NAT) changes IP addresses and protocol port numbers too. It is the most popular form of NAT.

Twice NAT is another variant of NAT. it is used with site that runs server. In this process NAT box is connected to Domain Name.

What are some of the metrics used by routing protocols?            (3 Marks)

Answer:- click here for detail

2 types of metrics used by routing protocols are:

-Hop count-this is the number of routers a packet must travel through to get to its destination -Bandwidth-this is the “speed” of a link also known as the data capacity of a link

 

How ICMP can be used to test different tools?            (3 Marks)

Answer:- rep

You are working in a Star organization as a network engineer. The existing network comprises of 120 systems. What will be your analysis about delay should it should be smaller or higher? Give reasons.
(3 Marks)

ABC industry is using different network technologies in its branches. Can all branches communicate with each other? If No, then give reason? [3]

 

Which type of NAT fails if an application uses the IP addresses instead of domain name? And why? (3 Marks)

Answer:- (Page 132)

Twice NAT fails if an application uses the IP addresses instead of Domain Name. Because Basic NAT does not work well for communication initiated from the Internet. Twice NAT allows a site to run servers. It requires the DNS to interact with the NAT device.

What are the main advantages and disadvantages of routing information protocol (RIP)?        (5 Marks)

Answer:- rep

18

 

 

 

 

 

Network engineer has three address resolution methods. How many methods does TCP/IP support in a real environment? Write names of methods and support your answer with solid reason? (5 Marks)

Answer:-

Address resolution algorithms can be grouped into three basic categories:

• Table lookup

• Closed-form computation

• Message Exchange

TCP/IP can use any of the three address resolution methods depending on the addressing scheme used by the underlying hardware.

 

Have any technique used for achieving reliability in TCP?            (5 Marks)

Answer:- rep

 

 

CS610 Current Final Term Papers

Fall 2011

 

Why EGP not use routing metric?       (5 Marks)

Answer:- rep

 

What is the difference between an interior gateway protocol and an exterior gateway protocol? Name an

example of each.                (5 Marks)

Answer:- (Page 135)

INTERIOR GATEWAY PROTOCOLS (IGPs):

It is used among routers within autonomous system. The destinations lie within IGP. EXTERIOR GATEWAY PROTOCOLS (EGPs):

It is used among autonomous systems. The destinations lie throughout Internet

 

As the Internet grew, the original Classful addressing scheme became a limitation, what is the designed

solution.                 (5 Marks)

Answer:- (Page 90)

As the Internet grew, the original Classful addressing scheme became a limitation. The IP address space was being exhausted because all networks had to choose one of three possible sizes. Many addresses were unused. Two new mechanisms were invented to overcome the limitations, which are as follows:

• Subnet addressing

• Classless addressing

Instead of having three distinct address classes, allow the division between prefix and suffix to occur on an

arbitrary boundary. The classless addressing scheme solves the problem by allowing an ISP to assign a prefix that is, 28 bits long (allowing the host to have up to 14 hosts).

 

 

19

 

 

 

 

How can a datagram are transmitted across a physical network that does not understand the datagram

format?           (2 Marks)

Answer:-    Click here for detail

When an IP datagram is encapsulated in a frame, the entire datagram is placed in the data area of a frame.

 

Describe the process of routing packets    (2 Marks)

Answer:-      Click here for detail

Routing is the act of moving information across an internet work from a source to a destination.

 

How ICMP can be used to trace a route?     (2 Marks)

Answer:-   (Page 118)

There are two possibilities used to detect the destination.

v  Send and ICMP echo request, destination host will generate an ICMP echo reply.

v  Send a datagram to a non-existent application, destination host will generate an ICMP destination
unreachable message.

 

What is the basic concept of Twice NAT (Network Address Translation?)        (2 Marks)

Answer:-  rep

What is the scale or level of requirement in of IPv6?           (2 Marks)

Answer:- rep

What are the three approaches for datagram forwarding?           (3 Marks)

Answer:- rep

What are the some of the metrics used by routing protocols?         (3 Marks)

How congestion control by TCP?                 (3 Marks)

Answer:- rep

 

 

 

CS610 Current Final Term Papers

Fall 2011

 

 

1: Limitations of parity checking?                    ( 2 mark )

Answer:- (Page 19)

Parity can only detect errors that change in odd number of bits for example the original data and parity is

10010001+1 (even parity) and the incorrect data is 10110011+1 (even parity). We see that even no. of bits have been changed due to noise so parity checking can not detect this error.

Parity usually is used to detect on bit error.

 

20

 

 

 

 

 

2: how can we prove that we have 2,147,483,648 addresses in class A.?                  ( 2 mark )

Answer:- Click here for detail

In class A, only 1 bit defines the class.
The remaining 31 bits are available
for the address. With 31 bits,

we can have 231or 2,147,483,648 addresses

 

3: what is meant by the client server paradigm?                  ( 2 mark )

Answer:- rep

 

4: why is internet multicast routing difficult?                  ( 2 mark )

Answer:-  rep

 

5: where should an ICMP message be sent?                  ( 2 mark )

Answer:- (Page 117)

ICMP message is sent in response to incoming datagrams with problems. ICMP message is not sent for ICMP message.

 

6: what is the basic concept of twice NAT?                 ( 2 mark )

Answer:-  rep

7: what are the some of the metrics used by routing protocols?         (3 Marks)

Answer:-  rep

8: How can switch virtual network be established?        (3 Marks)

Answer:- (Page 70)

Each pair of switches in the path communicates to choose a VPI/VCI for their tables. Once the connection is established by the destination, a message is sent back to the originating computer to indicate the SVC is ready. If any switch or the destination computer does not agree to setting up the VC, an error message is sent back and the SVC is not established.

 

9: Could IP be redesigned to use hardware addresses instead of the 32-bit addresses it currently uses.

Why or why not?       (3 Marks)

Answer:-  Click here for detail

No, IP is not redesigned to use hardware addresses instead of32-bit addresses

    IP addresses must have a hierarchical format so, it supports the hierarchical routing

    Hardware addresses such as the 48-bit Ethernet addresses are chosen from a flat address space and have
no provision for a “network address” to be used for Internet routing.

 

 

 

 

21

 

 

 

 

 

 

10: Three features of dynamic message method in ARP.       (3 Marks)

Answer:- (Page 97)

 

 

 

 

 

 

 

 

 

 

11: in internet routing how does a host join or leave a group?        (3 Marks)

Answer:-  rep

12: why TCP is called end to end protocol?        (3 Marks)

Answer:- (Page 123)

It provides application-to-application communication.

Applications can request a connection. TCP connections are called Virtual Connections. They are created by software only. Internet does not provide software or hardware support for the connections. TCP software modules on two computers create an illusion of a connection.

 

13: If IPV4 works so well. Why change it?           (5 Marks)

Answer:- rep

 

 

15: Main advantages and disadvantages of Routing Information Protocol.      (5 Marks)

Answer:- rep

 

FINALTERM EXAMINATION Spring 2010

CS610- Computer Network

 

Question No: 31 ( Marks: 2)

Does OSPF only share information within area or does it allow communication between areas?

Answer:- rep

 

Question No: 32 ( Marks: 2 )

Define what is extension head in IPv6

Answer:- (Page 111)

Additional information is stored in optional extension headers, followed by data.

22

 

 

 

 

 

Question No: 33 ( Marks: 2 )

What is implementation of NAT?

Answer:-  rep

 

Question No: 34 ( Marks: 2 )

Which wireless standard is used in WIFI technology?

Answer:-   (Page 29)

IEEE 802.11

 

Question No: 35 ( Marks: 2 )

How ICMP can be used to trace route?

Answer:-  rep

Question No: 36 ( Marks: 3 )

Write a note on “limited connectivity” of Wireless LAN.

Answer:-   (Page 29)

In contrast with wired LANs, not all participants may be able to reach each other Because:
v  It has low signal strength.

v  In wireless LANs the propagation is blocked by walls etc.

v  It can’t depend on CD to avoid interference because not all participants may hear.

 

Question No: 37 ( Marks: 3 )

In internet routing how can a host join or leave group?

Answer:-  rep

 

Question No: 38 ( Marks: 3 )

Provide three characteristics of UDP?

Answer:-  rep

 

Question No: 39 ( Marks: 5 )

What is meant by massage oriented interface in UDP also give the advantages and disadvantages of interface

Answer:- (Page 120)

UDP offers application programs a Message-Oriented Interface. It does not divide messages into packets for
transmission and does not combine messages for delivery. Let’s discuss its advantages and disadvantages.

 

ADVANTAGES:

• Applications can depend on protocol to preserve data boundaries.

 

DISADVANTAGES:

• Each UDP message must fit into a single IP datagram.

• It can result to an inefficient use of the underlying network

 

 

23

 

 

 

 

 

Question No: 40 ( Marks: 5 )
What is the role of  OSPF?

Answer:-  rep

 

 

FINALTERM EXAMINATION

Fall 2008

CS610- Computer Network

 

 

Question No: 51 (Marks: 2)

How can we prove that we have 2,147,483,648 addresses in class A?

Answer: – rep

 

Question No: 52 (Marks: 2)

Why is internet multicast routing difficult?

Answer: – rep

Question No: 53 (Marks: 2)

Define what is the Extension Headers in IPv6.

Answer: – rep

Question No: 54 (Marks: 3)

How does IP software reassemble fragments that arrive out of order?

Answer:- (CS610 ref.Book  Page 323)

When a packet is fragmented, the fragments must be numbered in such a way that the original data stream can
be reconstructed. One way of numbering the fragments is to use a tree. If packet 0 must be split up, the pieces
are called 0.0, 0.1, 0.2, etc. If these fragments themselves must be fragmented later on, the pieces are numbered

0.0.0, 0.0.1, 0.0.2. . . 0.1.0, 0.1.1, 0.1.2, etc. If enough fields have been reserved in the header for the worst case and no duplicates are generated anywhere, this scheme is sufficient to ensure that all the pieces can be correctly reassembled at the destination, no matter what order they arrive in.

 

Question No: 55 (Marks: 3)

What is the first address in the block if one of the addresses is 167.199.170.82/27?

Answer: – Click here for detail

Addressinbinary:10100111110001111010101001010010 Keeptheleft27bits:10100111110001111010101001000000 Result in CIDR notation:167.199.170.64/27

 

 

24

 

 

 

 

 

Question No: 56 (Marks: 3)

In internet routing how does a host join or leave a group?

Answer: – rep

 

Question No: 57 (Marks: 5)
Answer:- rep

Question No: 58 (Marks: 5)

Write a note on Address Resolution.

Answer:- (Page 93)

Mapping between a protocol address and a hardware address is called Address Resolution. A host or router uses address resolution when it needs to send a packet to another computer on the same physical network. A
computer never resolves the address of a computer that attaches to a remote network.

 

In the figure below a simple Internet with routers R1 & R2 connecting three physical networks is shown each network has two host computers attached.

 

 

FINALTERM EXAMINATION

Fall 2008

CS610- Computer Network

Question No: 21      ( Marks: 2 )

Is there a comparison between TCP/IP reference model and ISO reference model?

Answer:-  Click here for detail

The main differences between the two models are as follows:

TCP/IP combines the presentation and session layer issues into its application layer.

TCP/IP combines the OSI data link and physical layers into the network access layer.

TCP/IP appears to be a simpler model and this is mainly due to the fact that it has fewer layers.

 

Question No: 22      ( Marks: 2 )

Does OSPF only share information within an area or does it allow communication between areas?

Answer:- rep

 

Question No: 23      ( Marks: 2 )

What are the implementations of Network Address Translation?

Answer:- rep

 

Question No: 24      ( Marks: 3 )

Describe the difference between static and dynamic routing?

Answer:- rep

 

 

25

 

 

 

 

 

Question No: 25      ( Marks: 3 )

What is the first address in the block if one of the addresses is 140.120.84.24/20? Answer:-

The first address is140.120.80.0/20

 

Question No: 26      ( Marks: 3 )

Write three new features of IPV6.

Answer:- (Page 111)

• IPV6 addresses are 128 bits.

• Header format is entirely different.

• Additional information is stored in optional extension headers, followed by data.

• Flow label and quality of service allows audio and video applications to establish appropriate connections.

• New features can be added more easily. So it is extensible.

 

 

Question No: 27      ( Marks: 5 )

What is the difference between an interior gateway protocol and an exterior gateway protocol? Name an example of each.

Answer:- rep

 

Question No: 28      ( Marks: 5 )

As the Internet grew, the original Classful addressing scheme became a limitation, what is was the designed solution.

Answer:- rep

 

Question No: 29      ( Marks: 5 )

What is IPv6 ADDRESS NOTATION?

Answer:- rep

 

Question No: 30      ( Marks: 10 )

LIST SOME CHARACTERISTICS OF A CLIENT.

Answer:- (Page 145)

CHARACTERISTICS OF A CLIENT:

The characteristics of a client are explained below:
v  “Client is an arbitrary application program.
v  “It becomes client temporarily.

v  “It can also perform other computations.
v  “It is invoked directly by the user.
v  “It runs locally on the user’s computer.
v  “It actively initiates contact with a server.
v  “It contacts one server at a time.

 

 

 

26

 

 

 

 

FINALTERM EXAMINATION Fall 2008
CS610- Computer Network

Question No: 21      ( Marks:2)

Is there a comparison between TCP/IP reference model and OSI reference model?

Answer:- rep

 

Question No: 22      ( Marks:2)

How can a datagram be transmitted across a physical network that does not understand the datagram format?

Answer:- rep

 

Question No: 23      (Marks:2)

What is the basic concept of Twice NAT (Network Address Translation)?

Answer:- rep

 

Question No: 24      ( Marks:3)

What format is used for an internet packet?

Answer:- (CS610 ref.Book  Page 37)

The internet layer defines an official packet format and protocol called IP (Internet Protocol). The job of the internet layer is to deliver IP packets where they are supposed to go.

 

Question No: 25      ( Marks:3)

“To achieve a hierarchy, OSPF allows an autonomous system to be partitioned for routing purposes”. Does this feature make OSPF more complex or powerful?

Answer:- Click here for detail

OSPF allows an autonomous system to be partitioned for routing purposes which make it complex but More powerful.

Question No: 26      ( Marks:3)

Why does IPv6 use separate Extension Headers?

Answer:- (Page 113)

IPv6 use separate Extension Headers. Fragmentation information is kept in separate extension header. Each
fragment has base header and (inserted) fragmentation header. Entire datagram including original header may be fragmented.

 

Question No: 27      ( Marks:5)

Consider the IP addresses: 178.200.127.5 and the corresponding subnet masks 255.255.255.0, then find

out the following:

a.       The number of bits used for subnetting

b.      Total number of host in the subnet

c.       The network address of the subnet

d.       The subnet address of the IP address.

27

 

 

 

 

 

Answer:-    Click here for detail

a. The number of bits used for subnetting

Answer

8 bits

 

b. Total number of host in the subnet

Answer

254

 

c. The network address of the subnet.

Answer

178.200.127.0

 

Question No: 28      ( Marks:5)

How does IP software reassemble fragments that arrive out of order?

Answer:-  rep

 

Question No: 29      (Marks:5)

Write down the comparison of Distance- vector and Link – state algorithm?

Answer:- (Page 64)

COMPARISON:

DISTANCE-VECTOR ROUTING:

• It is very simple to implement.

• Packet switch updates its own routing table first.

• It is used in RIP.

LINK-STATE ALGORITHM:

• It is much more complex.

• Switches perform independent computations.

• It is used in OSPF.

 

 

Question No: 30      ( Marks:10)

Describe in detail what is the purpose of the following table? What sort of information can be extracted?

 

First Four Bits        Table index in       Class of Address

Of address                 decimal

0000                            0                              A

0001                            1                              A

0010                            2                              A

0011                            3                              A

0100                            4                              A

0101                            5                              A

0110                            6                              A

28

 

 

 

 

0111                            7                              A

1000                            8                               B

1001                            9                               B

1010                           10                              B

1011                           11                              B

1100                           12                              C

1101                           13                              C

1110                           14                             D

1111                           15                              E

 

Answer:- (Page 87)

Whenever it handles a packet, IP software needs to separate the destination address into a prefix and suffix. Classful IP addresses are self-identifying because the class of the address can be computed from the address itself. The table shows in the figure above how the class of address can be computed.

Question No: 31      (Marks: 10)

List down and describe at least five characteristics of Routing Information Protocol.

Answer:- (Page 138)

 

ROUTING INFORMATION PROTOCOL (RIP):

It has the following characteristics:

“It is used for routing within an autonomous system (IGP). “It uses UDP for all message transmissions.

“It can be used to advertise default route propagation. An organization can use RIP to install a default route in each router.

“It uses distance vector algorithm.

“RIP allows hosts to listen passively and update its routing table.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

29

 

VU CS610- Computer Network FinalTerm Solved Unsolved Past Papers Fall 2012

VU CS403- DATABASE MANAGEMENT SYSTEMS FINALTERM solved unsolved past papers Fall 2012

VU CS403- DATABASE MANAGEMENT SYSTEMS FINALTERM Solved Unsolved Past Papers Fall 2012

CS403 – Database Management Systems

JUNE 30,2012

Solved Subjective

From Final Term Papers

 

 

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2012 Fall

 

 

Question No: 1

 

Difference between Commit and Rollback. (Marks 2) Answer:- Click here for detail

 

in sql commit is used for saving the changes made in database and roll back is to roll back them , changes will not get saved in the database

 

Question No:2

 

Commonality between RAID technology and Tape Drive (Marks 2) Answer:-

Commonality between RAID technology and Tape Drive that they both are used for backup.

 

Question No: 3
Read the statement if incorrect rewrite in correct form.
“Hashing provides slow, time consuming data retrieve from sequential files”. (Marks 2)
Answer:- (Page 265)
Hashing provides rapid, non-sequential, direct access to records.
Question No: 4
How do you explain Cross Reference Matrix? (Marks 2)
Answer:- (Page 65)

 

This is a tool available in the data dictionary and helps us in finding entities of the database and their associations.

 

Question No: 5

Explain Redundant Data. How Data Redundancy work in sequence file.           (Marks 3)

Answer:-      (Page 14)

 

It means if different systems of an organization are using some common data then rather than storing it once and sharing it, each system stores data in separate files. This creates the problem of redundancy or wastage of storage and on the other hand the problem on inconsistency.

 

1

 

Question No: 6

 

State the basic difference between Inner join and Left Outer Join. . (Marks 3) Answer:- (Page 226 & 229)

 

Inner Join : Only those rows from two tables are joined that have same value in the common attribute while In a left outer join, PROGRAM rows without a matching COURSE row appear in the result left table (i.e. the one that precedes in SQL statement) regardless of the existence of matching records in the right table.

 

Question No: 7

Give one example of Deadlock.           (Marks 3)

Answer:-      Click here for detail

 

A simple computer-based example is as follows. Suppose a computer has three CD drives and three processes. Each of the three processes holds one of the drives. If each process now requests another drive, the three processes will be in a deadlock. Each process will be waiting for the “CD drive released” event, which can be only caused by one of the other waiting processes. Thus, it results in a circular chain.

 

Question No: 8

 

Create unique index on “IndexNum” on Cust_Name attribute of Customer table.. (Marks 3) Answer:- Click here for detail

 

CREATE INDEX IndexNum

ON Customer (Cust_Name)

 

Question No: 9
· Relate column 1 with column 2.. (Marks 5)
Column 1 Column 2
1. Sigma A. Procedural DML lang
2. Table B. Project operator
3. Relational Algebra C. Select operator
4. П D. Relational Data Model
5. Intersection operator E.   Binary operation

 

 

Answer:-
1. Sigma C. Select operator (Page 149)
2. Table D. Relational Data Model
3. Relational Algebra A. Procedural DML lang
4. ÏÏ B. Project operator
5. Intersection operator E. Binary operation

 

Question No: 10

 

Crater a VIEW INSTRUCTOR_LIST which shows the list of instructor table with Inst_Nam and City of these instructors belong to ISLAMABAD or KARACHI. INSTRUCTOR (Inst_ID, Imst_Name, City) (Marks 5)

 

 

2

 

Question No: 11

 

If a table 1 and table 2 have same entity and the table 1 is 20 index and the table 2 14 index. Then the sequential file access use these operations (Insertion, updation or selection) on both table. Keep in mind the above scenario and mark the below given statements correct or incorrect. (Marks 5)

 

  1. Insertion in table 1 take greater time than table 2
  2. Updation in table 2 take greater time then table 1
  3. Retrieving a record from table 1 take lesser time than table 2.

 

Question No: 12

Analyze the below given statements and mark as correct and incorrect and also explain.           (Marks 5)

 

  1. Deadlock occurs when one transaction wants to read more than on object at same time.
  2. The mechanism ―Wait for Graph‖ is used to apply join on multiple.

 

Answer:- (Page 320)

 

  1. Deadlock occurs when one transaction wants to read more than on object at same time. (Incorrect) Explanation: – A deadlock occurs when the first transaction has locks on the resources that the second transaction wants to modify, and the second transaction has locks on the resources that the first transaction intends to modify.

 

  1. The mechanism ―Wait for Graph‖ is used to apply join on multiple. (Incorrect)

 

Explanation: – It is used for the detection of deadlock. It consists of nodes and links. The nodes represent transaction, whereas arrowhead represents that a transaction has locked a particular data item.

 

 

 

 

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2012(fall)

 

Question No: 1

Name two types of anomalies?

 

Answer:-      (Page 162)

Two type of anomalies are:

 

  1. Insertion
  2. Deletion

 

Question No: 2 Name types of views?

 

Answer:-      (Page 283)

• Materialized View • Simple Views • Complex View • Dynamic Views

 

3

 

Question No: 3

 

Analyze the below given statements and mark as correct and incorrect and also explain. 1. Deadlock occurs when one transaction wants to read more than on object at same time. Answer:- (Page 320)

 

The given statement is incorrect. The correct statement is A deadlock occurs when the first transaction has locks on the resources that the second transaction wants to modify, and the second transaction has locks on the resources that the first transaction intends to modify.

 

Question No: 4

 

2. The mechanism “Wait for Graph” is used to apply join on multiple. Answer:- (Page 320)

The statement is incorrect and correct statement is

 

Wait – for Graph: It is used for the detection of deadlock

 

 

 

 

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2012(fall)

 

Question No: 1

How many ways to create a new view in your data base?                  (Marks 2)

Answer:-      (Page 283)

 

There are two ways to create a new view in your database. You can: • Create a new view from scratch. • Or, make a copy of an existing view and then modify it.

 

Question No: 2

Write any two similarities between Materialized views and indexes?                   (Marks 2)

Answer:-      (Page 290)

Materialized views are similar to indexes in several ways:

 

  • They consume storage space.
  • They must be refreshed when the data in their master tables changes.

 

Question No: 3

Which method is in DBMS to detect Deadlock? Briefly explain                    (Marks 3)

Answer:-      (Page 300)

The lock manager maintains a structure called a waits-for graph to detect deadlock cycles.

 

Question No: 4

Create new view as Product_list from the table PRODUCT including all the columns of the table

PRODUCT?

(Marks 5)

4

 

 

Question No: 5

Given two tables DOCTOR (D_ID,D_CONTACT) , MEDICINE(M- CODE, Description)

(i) Create unique index D_ID on DOCTOT

(ii)Create unique index on both M-CODE, Description                   (Marks 5)

 

Answer:-   Click here for detail

(i) CREATE UNIQUE INDEX D_ID

 

ON DOCTOT (D_ID,D_CONTACT)

 

Answer:-

(ii)CREATE UNIQUE INDEX D_ID

 

ON MEDICINE (M- CODE, Description)

 

 

 

 

 

 

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2011(fall)

 

Question No: 1

What are two primary modes for taking locks                 (Marks 2)

Answer: (Page 319)

There are two primary modes for taking locks: optimistic and pessimistic.

 

Question No: 2

 

How minimum cardinality finding is important for relationship (Marks 2) Answer: (Page 91)

 

It is very important to determine the minimum cardinality when designing a database because it defines the way a database system will be implemented.

 

Question No: 3

 

What are purpose of INPUT form (Marks 2) Answer: (Page 246)

 

Input forms are especially useful when the person entering the data is not familiar with the inner workings of Microsoft Access and needs to have a guide in order to input data accurately into the appropriate fields.

 

Question No: 4

What are three concurrency problems                  (Marks 3)

Answer:-      Click here for detail

The lost update problem.

 

The uncommitted dependency problem

The inconsistent analysis problem.

 

5

 

Question No: 5
Define composite key (Marks 3)
Answer:- Click here for detail

 

A primary key can consist of one or more columns of a table. When two or more columns are used as a primary key, they are called a composite key.

 

 

 

 

 

Question No:5

What is purpose behind HAVING clause                  (Marks 3)

Answer:-      (Page 223)

 

The HAVING clause is used in combination with the GROUP BY clause. It can be used in a SELECT statement to filter the records that a GROUP BY returns. At times we want to limit the output based on the corresponding sum (or any other aggregate functions).

 

Question No: 6

 

Write down five features of VIEWS                  (Marks 5)

Answer: (Page 281)

  1. A database view displays one or more database records on the same page.
  2. A view can display some or all of the database fields.
  3. Views have filters to determine which records they show.
  4. Views can be sorted to control the record order and grouped to display records in related sets.
  5. Views have other options such as totals and subtotals.

 

Question No: 7

 

What is purpose of VIEWS in DBMS (Marks 5) Answer:- (Page 280,281)

 

Views are generally used to focus, simplify, and customize the perception each user has of the database. Views can be used as security mechanisms by allowing users to access data through the view, without granting the users permissions to directly access the underlying base tables of the view.

 

Most users interact with the database using the database views. A key to creating a useful database is a well-chosen set of views. Luckily, while views are powerful, they are also easy to create.

 

Question No: 8

Write down syntax for IN clause –5 marks

Answer:-      Click here for detail

SELECT column_name(s)

 

FROM table_name

WHERE column_name IN (value1,value2,…)

 

 

 

 

 

6

 

Question No: 9

Differentiate Total and Partial completeness                   (Marks 5)

Answer:-      (Page 103)

Total Completeness:

 

Total Completeness constraint exist only if we have a super type and some subtypes associated with that supertype, and the following situation exists between the super type and subtype.

 

All the instances of the supertype entity must be present in at one of the subtype entities, i.e.—there should be not instance of the supertype entity which does not belong to any of the subtype entity.

 

 

Partial Completeness Constraint:

 

This type of completeness constraint exists when it is not necessary for any supertype entity to have its entire instance set to be associated with any of the subtype entity.

 

This type of situation exists when we do not identify all subtype entities associated with a supertype entity, or ignore any subtype entity due to less importance of least usage in a specific scenario.

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2011(fall)

 

Question No: 1

 

What is a transaction? What are ACID properties? Answer: (Page 291)

 

A transaction can be defined as an indivisible unit of work comprised of several operations, all or none of which must be performed in order to preserve data integrity.

 

ACID properties: Atomicity Consistency: Isolation: Durability:

 

Question No: 2

 

What happened when lack of durability in transaction? Answer:- Click here for detail

 

In case of lack of durability, if the transaction programs fails, or the operating system fails, once the transaction has committed, all updates will be loss.

 

Question No: 3

 

What is alternate key? Answer:- (Page 83)

Candidate keys which are not chosen as the primary key are known as alternate keys.

 

 

 

7

 

Question No: 4

What are five features of Views?

Answer:-      rep

 

Question No:5

 

Difference between Delete and truncate commands? Answer:- Click here for detail

 

The DELETE command is used to remove rows from a table while TRUNCATE removes all rows from a table After DELETE you need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it while In TRUNCATE The operation cannot be rolled back

 

IN DELETE triggers will be fired while in TRUNCATE no triggers will be fired. TRUCATE is faster and doesn’t use as much undo space as a DELETE

 

Question No: 6

 

What is the purpose of DML commands? Answer:- (Page 200)

 

Data Manipulation is retrieval, insertion, deletion and modification of information from the database. A DML is a language, which enables users to access and manipulate data. The goal is to provide efficient human interaction with the system.

 

Question No: 7

 

What is serial execution? Answer:- (Page 312)

Serial execution is an execution where transactions are executed in a sequential order, that is, one after another.

 

Question No: 8

What are the features of indexed serial execution?

 

Question No: 9

 

What is Unary and Ternary relationship? Answer:- (Page 87 & 88)

 

Unary Relationship An ENTITY TYPE linked with itself, also called recursive relationship. Ternary Relationship A Ternary relationship is the one that involves three entities

 

 

 

 

 

CS403 – Database Management Systems

 

Final term Subjective Paper 2011(fall)

 

Question No: 1

What is the difference between Commit and rollback?                  (Marks 2)

Answer:-      rep

 

 

8

 

Question No: 2

What is the problem which occur in normalization of 1 form of normalization                  (Marks 2)

Answer:-      (Page 167)

 

There is no multi valued (repeating group) in the relation multiple values create problems in performing operations like select or join

 

Question No: 3

Why will you prefer direct access over sequential access?                  (Marks 2)

Answer:-      (Page 261)

 

Sequential files provide access only in a particular sequence. That does not suit many applications since it involves too much time. Some mechanism for direct access is required

 

Question No: 4

 

What type of information is stored in data dictionary?                  (Marks 3)

Answer:-      (Page 64)

 

Data dictionaries store all the various schema and file specifications and their locations. They also contain information about which programs use which data and which users are interested in which reports.

 

Question No: 5

 

What problem occurs when data concurrency is not controlled? (Marks 3) Answer:- rep

 

Question No: 6

What is the purpose of file protection?                 (Marks 3)

Answer:-      (Page 261)

 

When multiple users have access to files, it may be desirable to control by whom and in what ways files may be accessed. This control is known as file protection.

 

Question No: 7

What are database objects?                 (Marks 5)

Answer:-      Click here for detail

 

An object database (also object-oriented database management system) is a database management system in which information is represented in the form of objects as used in object-oriented programming. Object databases are different from relational databases and belong together to the broader database management system.

 

Question No: 8

 

Write sql statement for display list of persons in table PERSON and show only that records whose first name is Ahmed and who’s Last name is Ali (Marks 5)

 

Answer:-

CREATE TABLE Persons1

 

(

 

FirstName varchar(15), LastName varchar(15),

 

9

 

Address varchar(15), City varchar(15)

 

)

 

INSERT INTO Persons1

VALUES (‘aslam’,’kashif’,’civil line’,’Karachi’)

 

INSERT INTO Persons1

VALUES (‘shahid’,’ali’,’Defence’,’Lahore’)

 

INSERT INTO Persons1

VALUES (‘kamran’,’shaheen’,’Shadman’,’Faisalabad’)

 

INSERT INTO Persons1

VALUES (‘Ahmad’,’Ali’,’Muslim Town’,’Multan’)

 

INSERT INTO Persons1

VALUES (‘shamas’,’khan’,’shah street’,’Koita’)

 

SELECT *

FROM Persons1

WHERE FirstName=’Ahmad’ AND LastName=’Ali’

 

Question No: 9

What is unary and ternary Relationship?                 (Marks 5)

Answer:-      rep

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2011(fall)

Question No: 1

 

Application programmer as user of database systems,                (Marks 5)

Answer:-      (Page 24)

 

Application programmers design the application according to the needs of the other users of the database in a certain environment. Application programmers are skilled people who have clear idea of the structure of the database and know clearly about the needs of the organizations.

 

Question No:2

 

Differentiate between rollback and rollforward. (Marks 5) Answer:- Click here for detail

 

Rollback :- Undoing the changes made by a transaction before it commits or to cancel any changes to a database made during the current transaction

 

RollForward :- Re-doing the changes made by a transaction after it commits or to overwrite the changed calue again to ensure consistency

 

10

 

Question No: 3

 

why will you prefer delete command on drop command while deleting a table (Marks 5) Answer:- http://stackoverflow.com/questions/1143915/what-is-the-difference-between-drop-table-and-delete-table-in-sql-server

 

Drop table. it will delete complete table from th Database.it can not retrieved back. Delete is used to deleting data from the table… Data can be retrieved using Rollback.

 

Question No: 4

how many number of clusters are used in database and reason of limit

 

Question No: 5

 

purpose of having clause Answer:- rep

 

Question No: 6 purpose of protection Answer:- rep

 

Question No: 7

 

explain data independency Answer:- (Page 16)

 

Data and programs are independent of each other, so change is once has no or minimum effect on other. Data and its structure is stored in the database where as application programs manipulating this data are stored separately, the change in one does not unnecessarily effect other.

 

Question No: 8

 

two types of interface Answer:- (Page 240)

Following are the two types of user interfaces:

 

  • Text based
  • Graphical User Interface (GUI) most commonly called as Forms

 

Question No: 9

 

Write DML statement that changes the values of one or more than one attribute based on some condition.

 

Answer:-      (Page 208)

The UPDATE statement changes the values of one or more columns based on some condition.

 

Question No: 10

 

Describe insertion anomaly Answer:- Click here for detail

 

insertion anomaly indicates that we cannot insert a fact about one entity until we have an additional fact about another entity. Suppose we want to store the information that the cost of car is Rs. 14,00,000, but we cannot

 

11

 

enter this data into the relation until the data about the car is entered into the relation.

 

Question No: 11

COMMIT and ROLLBACK

Answer:-      rep

 

 

 

 

 

CS403 – Database Management Systems Final term Subjective Paper 2011(fall)

Question No: 1

 

What is the purpose of IN Functions? Answer:- (Page 218)

The IN function helps reduce the need to use multiple OR conditions. It is sued to check in a list of values.

 

Question No: 2

 

In which situation join is used? Answer:- Click here for detail

 

The JOIN keyword is used in an SQL statement to query data from two or more tables, based on a relationship between certain columns in these tables.

 

Tables in a database are often related to each other with keys.

 

Question No: 3

What is serial execution?

Answer: –      rep

 

Question No: 4

Write three advantages of views?

Answer: –      rep

 

Question No: 5

 

What are locking protocols, explain? Answer:- (Page 297)

 

A locking protocol is a set of rules to be followed by each transaction (and enforced by the DBMS), in order to ensure that even though actions of several transactions might be interleaved, the net effect is identical to executing all transactions in some serial order.

 

Question No: 6 What is rehashing?

 

Answer:-      (Page 267)

 

Re-hashing schemes use a second hashing operation when there is a collision. If there is a further collision, we re-hash until an empty “slot” in the table is found. The re-hashing function can either be a new function or a re-application of the original one.

 

12

 

Question No: 7

 

In which situation self join is used? Answer:- (Page 231)

 

In self join a table is joined with itself. This operation is used when a table contains the reference of itself through PK, that is, the PK and the FK are both contained in the same table supported by the referential integrity constraint.

 

Question No: 8

Why direct access is preferred over sequential access?

Answer:-      rep

 

Question No: 9

 

Define the domain of attribute?               (Marks 2)

Answer:-      (Page 76)

 

Domain is the set of possible values that an attribute can have, that is, we specify a set of values either in the form of a range or some discrete values, and then attribute can have value out of those values.

 

 

 

 

 

 

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2011(fall)

 

 

Question No:1

 

Explain Secondary key and give it‟s an example. Answer:- Click here for detail

 

An entity may have one or more choices for the primary key. Collectively these are known as candidate keys. One is selected as the primary key. Those not selected are known as secondary keys.

 

For example, an employee has an employee number, a National Insurance (NI) number and an email address. If the employee number is chosen as the primary key then the NI number and email address are secondary keys. However, it is important to note that if any employee does not have a NI number or email address (i.e.: the attribute is not mandatory) then it cannot be chosen as a primary key.

 

Question No: 2

 

Three Factors when designing an indexed sequential file. Answer:- (Page 261)

 

The simplest indexing structure is the single-level one: a file whose records are pair‘s key-pointer, where the pointer is the position in the data file of the record with the given key.

 

13

 

Question No: 3

 

Procedure which truncates command removes the data. Answer:- (Page 207)

 

The TRUNCATE is used to delete all the rows of any table but rows would exist. If we want to remove all records we must use TRUNCATE.

 

 

Question No:

What is the mean of “Operational maintenance” of database?

Answer:- (Page 56)

 

Maintenance means to check that all parts of the system are working and once the testing of the system is completed the periodic maintenance measure are performed on the system to keep the system in working order.

 

Question No:

Three problems which concurrency not controlled.

Answer:- rep

 

Question No:

Two primary modes of taking locks.

Answer:- rep

 

Question No:

What is the basics purpose of window control? Give an example.

Answer:- (Page 244)

Used to take input and display output like buttons, checkboxes etc.

 

Question No:

Why prefer direct access over sequential access of files.

Answer:- rep

 

Question No:

 

Name two types of completeness Constraint. Answer:- (Page 103)

 

There are two types of completeness constraints, partial completeness constraints and total completeness constraints

 

Question No:

 

Basic Syntax of INDEX. Answer:- Click here for detail CREATE INDEX index_name ON table_name (column_name)

 

 

 

 

 

 

14

 

CS403 – Database Management Systems

 

Final term Subjective Paper 2011(fall)

 

 

Question No:

 

Write any two similarities between matererialized views and indexs (Marks 2) Answer:- rep

 

Question No:

Name two types of data dictionary                (Marks 2)

Answer:- (Page 65)

Types of Data Dictionaries:

Integrated

Free Standing

 

Question No:

What is the role of commit                         (Marks 2)

Answer:- rep

 

Question No:

Write an sql statement to remove an index called Index Number                       (Marks 2)

Answer:- Click here for detail

 

DROP INDEX Syntax for MS SQL Server:

DROP INDEX table_name. Index Number

 

Question No:

In context with transaction what does the ACID Stands for                      (Marks 2)

Answer:- (Page 291)

Atomicity Consistency isolation durability.

 

Question No:

States the major disadvantage of creating and using index                 (Marks 3)

Answer:- Click here for detail

 

Firstly, the indexes take up disk space.

Secondly, the indexes slow down the speed of writing queries, such as INSERT, UPDATE and DELETE.

 

Question No:
Write two factors which enforce a relation into send normal form

(Marks 3)

Answer:- (Page 166)
eliminate redundant data
ensure data dependencies make sense

15

 

 

Question No:

Write any five advantage of database system                (Marks 5)

Answer:- Click here for detail

Reduced data redundancy

Reduced updating errors and increased consistency

Greater data integrity and independence from applications programs

Improved data access to users through use of host and query languages

Improved data security

 

Question No:

Describe To_Date() function                (Marks 5)

Answer:- Click here for detail

 

The TO_DATE function converts a formatted TEXT or NTEXT expression to a DATETIME value. This function is typically used to convert the formatted date output of one application (which includes information such as month, day, and year in any order and any language, and separators such as slashes, dashes, or spaces) so that it can be used as input to another application.

 

Question No:

 

Explain database objects 5 Answer:- rep

 

 

 

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2011(fall)

 

Question No:

 

Q1- What is Logical data base? Answer:- (Page 187)

In logical data base design we group things logically related through same primary key.

 

Question No:

 

Q2- How do we DELETE row by row from the table ? Answer:- Click here for detail

 

It is possible to delete all rows in a table without deleting the table. This means that the table structure, attributes, and indexes will be intact:

 

DELETE * FROM table_name

 

Q3- Write down the Three types of view.

Answer:- rep

 

Q4- Write down the syntax of command CREATING INDEX.

Answer:- rep

 

16

 

Q5- What do u mean by GROUP By command Answer:- Click here for detail

 

The GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by one or more columns.

 

Q6- Give the implementation of One to many relationship

Answer:- (Page 92)

 

 

 

 

 

 

 

 

 

Q7- Give similarities between Materialized view and indexes

Answer:- rep

 

 

 

 

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2011(fall)

 

Q no: 1

Write the two types of ordered indices?

 

Answer:- (Page 276)

There are Two types of ordered indices:

 

Dense Index:

Sparse Index:

 

Q no: 2

Write three types of data Independence?

Answer:- Click here for detail

  1. Logical Data Independence
  2. Physical Data Independence
  3. View Data Independence

 

Q no: 3

 

How do we prevent deadlock in DBMS? Answer:- (Page 299)

 

We can prevent deadlocks by giving each transaction a priority and ensuring that lower priority transactions are not allowed to wait for higher priority transactions (or vice versa).

 

17

 

Q no:4

 

How the lost Updates are in DBMS? Answer:- (Page 308)

Lost Update Problem This problem occurs when multiple users want to update same object at the same time.

 

Q no: 5

 

Differentiate b/w Clustered Indexes and non Clustered Indexes? Answer:- Click here for detail

 

Cluster Index

 

1 A cluster index is a form of tables which consist of column and rows. 2 Cluster index exists on the physical level

 

3 It sorts the data at physical level

 

4 It works for the complete table

5 There is a whole table in form of sorted data 6 A table can contain only one cluster index

 

Non Cluster Index

1 A non cluster index is in the form of a report about the tables.

 

2 They are not created on the physical level but at the logical level 3 It does not sort the data at physical level

 

4 A table has 255 non clustered indexes

5 A table has many non clustered indexes.

6 It work on the order of data

 

Q no: 6

 

what are the purposes of creating views in DBMS? Answer:- rep

 

Q no: 7

 

Write about NOT operators? Answer:- Click here for detail

 

If you want to find rows that do not satisfy a condition, you can use the logical operator, NOT. NOT results in the reverse of a condition. That is, if a condition is satisfied, then the row is not returned.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

18

 

CS403 – Database Management Systems

Final term Subjective Paper 2011(fall)

 

 

Question#1              (Marks 2)

SELECT * FRO Persons

 

WHERE Firstname Like ―% da %‖;

 

What does the above statement returne? Answer:-

Return all records containing L in attribute name ‗Firstname‘ from persons table.

 

 

Question#2               (Marks 2)

 

What is the difference between Primary key and a unique key with reference to clustered and non-clustered indexes?

 

Answer:- Click here for detail

 

Primary key can not be null but unique can have only one null value. Primary key create the cluster index automatically but unique key not. A table can have only one primary key but unique key more than one.

 

Question#3               (Marks 5)

Create a simple index, named ―Personal Index‖ on the LastName field of the person table?

 

Answer:- Click here for detail TABLE person

 

(

 

FirstName char(15), LastName char(15), Address char(50), City char(50), Country char(25),

 

)

 

CREATE INDEX new_person_ LastName on person (LastName)

 

Question#4               (Marks 5)

Writing the basic syntax of adding a record to a table.

 

Answer:- Click here for detail

INSERT INTO table_name

VALUES (value1, value2, value3…)

 

 

 

 

19

 

Question#5               (Marks 5)

Give 4 similarities between Materialized views and indexes?

 

Answer:- (Page 290)

  • They consume storage space.
  • They must be refreshed when the data in their master tables changes.
  • They improve the performance of SQL execution when they are used for query rewrites.
  • Their existence is transparent to SQL applications and users.

 

Question#6               (Marks 3)

How the stamping approach does works to give priorities to the transactions?

 

Question#7               (Marks 3)

Name the primary key modes for taking locks?

 

Answer:- rep

 

Question#8               (Marks 2)

State any two problems that can come up as a result of inconsistent data base?

 

Answer:- (Page 307)

Lost Update Problem

 

Uncommitted Update Problem

Inconsistent Analysis Problem

 

 

 

 

CS403 – Database Management Systems

Final term Subjective Paper 2011(fall)

 

Question No:

Q# briefly describes the dynamic view.               (Marks 5)

 

Answer:- (Page 284)

 

Dynamic views are those types of views for which data is not stored and the expressions used to build the view are used to collect the data dynamically. These views are not executed only once when they are referred for the first time, rather they are created and the data contained in such views is updated every time the view is accessed or used in any other view or query. Dynamic views generally are complex views, views of views, and views of multiple tables.

 

Question No:

Q# briefly explains the significance of not null constraint.               (Marks 5)

 

Answer:- Click here for detail

 

NOT NULL constraints in Microsoft SQL Server allow you to specify that a column may not contain NULL values. When you create a new NOT NULL constraint on a database column, SQL Server checks the column‘s current contents for any NULL values. If the column currently contains NULL values, the constraint creation fails. Otherwise, SQL Server adds the NOT NULL constraint and any future INSERT or UPDATE commands that would cause the existence of a NULL value fail.

 

20

 

Question No:

Q# what is truncation and what are ACID properties?              (Marks 5)

 

Answer:- rep

 

Question No:

Q# briefly explains the mechanism of optimistic locking mod.                (Marks 3)

 

Answer:- (Page 319)

 

In an optimistic locking mode, the first transaction accesses data but does not take a lock on it. A second transaction may change the data while the first transaction is in progress. If the first transaction later decides to change the data it accessed, it has to detect the fact that the data is now changed and inform the initiator of the fact.

 

Question No:

Q# writes the procedure following which the truncate command removes the data.              (Marks 3)

 

Answer:- (Page 207)

 

The TRUNCATE is used to delete all the rows of any table but rows would exist. If we want to remove all records we must use TRUNCATE.

 

TRUNCATE TABLE table_name

 

Question No:

Q# why do we need meta data?              (Marks 3)

 

Answer:- (Page 23)

 

For storage of the data related to any entity or object existing at real world level we define the way the data will be stored in the database. This is called Meta data.

 

Question No:

Q# name three difference classification of indexes?               (Marks 3)

 

Answer:- (Page 272)

Indexes are classified as under:

 

• Clustered vs. Un-clustered Indexes

• Single Key vs. Composite Indexes

• Tree-based, inverted files, pointers

 

Question No:

Q# suppose  you want to delete a table row by row and record an entry in the transaction log for each delete

row. Which DML command will you use?               (Marks 2)

 

Answer:- rep

 

Question No:

Q# writes an SQL statement to remove an index called ‗IndexNumber‘?              (Marks 2)

 

Answer:- Click here for detail

DROP INDEX table_name.IndexNumber

 

 

21

 

Question No:

Q# what are the participant of a relationship?               (Marks 2)

 

Answer:- (Page 86)

Entities enrolled in a relationship are called its participants

 

Question No:

Q# writes any tow similarities between materialized view and indexes?               (Marks 2)

 

Answer:- rep

 

 

 

 

 

FINALTERM EXAMINATION

Spring 2010

CS403- Database Management Systems

Question No: 28 ( M a r k s: 2 )
Define domain of an attribute.
Answer:- rep
Question No: 29 ( M a r k s: 2 )

Write the main feature of volatile storage media?

 

Answer:- (Page 255)

Computer storage that is lost when the power is turned off is called as volatile storage. For example RAM

 

Question No: 30   ( M a r k s: 2 )

 

Suppose you want to delete a table row by row and record an entry in the transaction log for each deleted row. Which DML command will you use?

 

Answer:- rep

 

Question No: 31   ( M a r k s: 3 )

Write three benefits of using VIEWS.

 

Answer:- rep
Question No: 32 ( M a r k s: 3 )
SELECT * FROM Persons
WHERE FirstName LIKE ‘%da%’;
Question No: 33 ( M a r k s: 3 )

 

What is the difference between a primary key and a unique key with reference to clustered and nonclustered indexes?

 

Answer:- rep

 

22

 

Question No: 34   ( M a r k s: 5 )

Consider a table named COMPANY with fields COMPANY_NAME,

 

DESCRIPTION, ORDER_NUMBER. Write an SQL statement to display company names in reverse alphabetical order.

 

Answer:- Click here for detail select COMPANY_NAME

 

from COMPANY order by COMPANY_NAME desc;

 

Question No: 35   ( M a r k s: 5 )

 

Name the five main components of Database management systems software. Answer:- Click here for detail

 

  1. DBMS engine
  2. Data definition subsystem
  3. Data manipulation subsystem
  4. Application generation subsystem
  5. Data administration subsystem

 

Question No: 36   ( M a r k s: 5 )

Give 4 similarities between Materialized views and indexes.

 

Answer:- rep

 

 

 

 

 

FINALTERM EXAMINATION

Spring 2010

CS403- Database Management Systems (10 Aug 2010)

Question No: 23 ( M a r k s: 2 )
Give 2 similarities between Materialized views and indexes.
Answer:- rep
Question No: 24 ( M a r k s: 2 )

 

What are the forms of cache normally used in desktop computers Answer:- Click here for detail

 

Two types of caching are commonly used in personal computers: memory caching and disk caching.

 

Question No: 25 ( M a r k s: 3 ) Write the properties of Sequence File Answer:- (Page 259)

 

Records are arranged on storage devices in some sequence based on the value of some field, called sequence field. Sequence field is often the key field that identifies the record.

 

23

 

Simply, easy to understand and manage, best for providing sequential access. It is not feasible for direct or random access; inserting/deleting a record in/from the middle of the sequence involves cumbersome record searches and rewriting of the file.

 

Question No: 26   ( M a r k s: 3 )

 

What is meant by database recovery services? Answer:- (Page 47)

 

Recovery services mean that in case a database gets an inconsistent state to get corrupted due to any invalid action of someone, the DBMS should be able to recover itself to a consistent state, ensuring that the data loss during the recovery process of the database remains minimum.

 

Question No: 27   ( M a r k s: 5 )

 

Write four steps to recover from a deadlock between the transactions Answer:- (Page 320)

Following are some of the approaches for the deadlock handling:

  • Deadlock prevention
  • Deadlock detection and resolution
  • Prevention is not always possible
  • Deadlock is detected by wait-for graph

 

Question No: 28   ( M a r k s: 5 )

Consider a table named COMPANY with fields COMPANY_NAME,

 

DESCRIPTION, ORDER_NUMBER. Write an SQL statement to display company names in reverse alphabetical order.

 

Answer:- rep

 

Question No: 29 ( M a r k s: 5 ) Write five advantages of using VIEWS. Answer:- rep

 

 

 

 

 

 

 

 

FINALTERM EXAMINATION

Spring 2010

CS403- Database Management Systems (Session – 1)

 

Question No: 27  ( M a r k s: 2 )

Name the two types of ordered Indices.

 

Answer:- rep

 

 

24

 

Question No: 28  ( M a r k s: 2 )

State any two problems that can come up as a result of inconsistent database.

 

Answer:- rep

 

Question No: 29  ( M a r k s: 2 )

Write the main purpose of NOT operator.

 

Answer:- rep

 

Question No: 30  ( M a r k s: 2 )

What is ‗Serial Execution‘?

 

Answer:- rep

 

Question No: 31  ( M a r k s: 3 )

State the main purpose of index in relation with the queries executions.

 

Answer:-

Index help to better recovery and retrieval of record from the database..

 

By building index on any attribute will help the queries to improve query performance. Multiple indexes provide flexibility to retrieve the data from various attributes.

 

Question No: 32  ( M a r k s: 3 )

What is the purpose of IN operator?

 

Answer:- rep

 

Question No: 33  ( M a r k s: 3 )

What effect can be occurred if a transaction lacks durability?

 

Answer:- rep

 

Question No: 34  ( M a r k s: 5 )

Write the basic syntax of creating an INDEX.

 

Answer:- rep

 

Question No: 35  ( M a r k s: 5 )

What is the purpose of creating VIEWS in DBMS?

 

Answer:- rep

 

Question No: 36  ( M a r k s: 5 )

 

Write an SQL statement which displays a list of persons from the table named PERSON. The complete information of only those person should be displayed whose first name is ALI and the last name is AHMED; SELECT * FROM Person where FirstName = ‗ALI‘ and Lastname = ‗AHMED‘;

 

Answer:- rep

 

 

 

 

 

 

25

 

FINALTERM EXAMINATION

Spring 2010

 

CS403- Database Management Systems (Session – 1)

 

Question No: 27      ( M a r k s: 2 )

What is the ―data type‖?

 

Answer:- (Page 197)

 

In Microsoft SQL Server™, each column, local variable, expression, and parameter has a related data type, which is an attribute that specifies the type of data (integer, character, money, and so on) that the object can hold.

 

Question No: 28      ( M a r k s: 2 )

Which DML statement changes the values of one or more columns based on some conditions.

 

Answer:- (Page 209)

The UPDATE statement changes the values of one or more columns based on some condition.

 

Question No: 29      ( M a r k s: 2 )

Name the two types of caching that are commonly used in personal computers?

 

Answer:-  rep

 

Question No: 30      ( M a r k s: 2 )

What is ‗Serial Execution‘?

 

Answer:-  rep

 

Question No: 31      ( M a r k s: 3 )

Write three benefits of using VIEWS.

 

Answer:-  rep

 

Question No: 32      ( M a r k s: 3 )

Shortly explain BYTE data field?

 

Answer:- (Page 197)

 

Some of more frequently supported numeric data types include Byte, Integer, and Long Integer. Each of these types supports different range of numeric values and takes 1, 4 or 8 bytes to store. Now, if we declare the age attribute as Long Integer, it will definitely serve the purpose, but we will be allocating unnecessarily large space for each attribute. A Byte type would have been sufficient for this purpose since you won‘t find students or employees of age more than 255, the upper limit supported by Byte data type.

 

Question No: 33      ( M a r k s: 3 )

State the main purpose of index in relation with the queries executions.

 

Answer:-  rep

 

Question No: 34      ( M a r k s: 5 )

Differentiate between the cluster index and non cluster index ?

 

26

 

Answer:-  rep

 

Question No: 35      ( M a r k s: 5 )

Consider the two relations,

 

Department (Dept_Code, Dep_Name,Dept_Head) and

Employee(Emp_ID,Emp_Name, Designation, DoB, Dept).

 

Write SQL statement to drop the primary key of Department relation? The fields in Employee should reflect the removal in Department table.

 

Answer:-

ALTER TABLE  Department

 

DROP COLUMN Dept_Code

 

 

 

 

 

 

FINALTERM EXAMINATION

Fall 2009

 

CS403- Database Management Systems

 

 

 

Question No: 31 ( Marks: 1 ) What is procedural DML? Answer:- (Page 200)

Procedural DML is, in which the user specifies what data is needed and how to get it

 

Question No: 32 ( Marks: 1 )

What does RAM stand for?

Answer:-

Random access memory

 

Question No: 33 ( Marks: 2 )

 

Which DML statement changes the values of one or more columns based on some conditions. Answer:- rep

 

Question No: 34 ( Marks: 2 )

Name the two primary modes for taking Locks

Answer:- rep

 

Question No: 35 ( Marks: 3 )

Give three reasons of partitioning in the process of denormalization.

 

27

 

Answer:- (Page 189)

  1. Reduce workload (e.g. data access, communication costs, search space)

 

  1. Balance workload
  2. Speed up the rate of useful work (e.g. frequently accessed objects in main memory)

 

Question No: 36 ( Marks: 3 )

 

Write any three factors which we consider while defining key in designing an indexed sequential file? Answer:- (Page 263)

  • Position and size
  • Data type
  • Index number

 

Question No: 37 ( Marks: 3 )

 

Create a unique index named „ IndexNum‟ on the „CustName‟ column of the table „Customer‟.

Answer:- rep

 

Question No: 38 ( Marks: 5 )

 

Write a query to change the “status” field in the table “name_table” against the phone 34657. Make the status as enable.

 

Answer:- Click here for detail SYNTAX:

 

sp_RENAME ‘TableName.[OldColumnName]’ , ‘[NewColumnName]’, ‘COLUMN’

 

sp_RENAME ‘ name_table.[ phone]’ , ‘[phNo]’, ‘COLUMN’

 

Question No: 39 ( Marks: 5 )

 

Describe ATOMICITY as one of the properties of TRANSACTION. Answer:- Click here for detail

 

one of the ACID transaction properties. In an atomic transaction, a series of database operations either all occur, or nothing occurs. A guarantee of atomicity prevents updates to the database occurring only partially, which can cause greater problems than rejecting the whole series outright. In other words, atomicity means indivisibility and irreducibility.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

28

 

FINALTERM EXAMINATION

Fall 2008

 

CS403- Database Management Systems (Session – 3)

 

CS403 Question No: 31

What is Ordering field?

 

Answer:-

Answer: Ordering field means to sort the cells or field in ascending or descending order.

 

CS403 Question No: 32

Which clause is used to sort the records in the result set?

 

Answer:- (Page 219)

The ORDER BY clause allows you to sort the records in your result set.

 

CS403 Question No: 33                     ( M a r k s: 2 )

What is the major benefit of HASH paritioning?

 

Answer:- (Page 189)

hash partitioning reduces the chances of unbalanced partitions to a large extent

 

CS403 Question No: 34                     ( M a r k s: 2 )

How can we prevent deadlocks for concurrent Transactions?

 

Answer:- rep

 

CS403 Question No: 35                     ( M a r k s: 3 )

State the major disadvantage of creating and using index.

 

Answer:- rep

 

CS403 Question No: 36                     ( M a r k s: 3 )

Write any three factors which we consider while defining key in designing an indexed sequential file?

 

Answer:- rep

 

 

CS403 Question No: 37                     ( M a r k s: 3 )

 

How do you select all records from the table using SQL statements? Write the syntax. Answer:- Click here for detail

 

SELECT * FROM table_name

 

CS403 Question No: 38                     ( M a r k s: 5 )

How can a VIEW be used for security measures?

 

Answer:- (Page 280)

 

Views can be used as security mechanisms by allowing users to access data through the view, without granting the users permissions to directly access the underlying base tables of the view.

 

29

 

CS403 Question No: 39                     ( M a r k s: 5 )

In which situtation do you prefer DELETE command to delete a table instead of using DROP command?

 

Answer:- rep

 

CS403 Question No: 40                     ( M a r k s: 10 )

Write four advantages and four disadvantages of De-normalization.

 

Answer:- Click here for detail

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CS403 Question No: 41                     ( M a r k s: 10 )

Explain and differentiate the two types of application users:

  • Intermediate
  • Expert

 

Answer:- (Page 242) Intermediate:-

 

For most systems, the majority of users fall into the intermediate category. Intermediate users know what the system does, but they often forget the details of how. This is the group you must support directly in the user interface. Fortunately, the Microsoft Windows interface provides a lot of tools for helping these users.A well-designed menu system is one of the best tools for reminding intermediate users of the system capabilities. A quick scan of the available menu items will immediately remind them of the functions available and at the same time allow them to initiate the appropriate task.

 

Experts:-

 

Expert users know what to do and how to do it. They’re primarily interested in doing things quickly. The more shortcuts you can build into your system, the happier you will make this group of users. In my experience, expert users tend to be keyboard- oriented, so make sure that you provide a way to move around the system using the keyboard if you’re catering to this group. Expert users also appreciate the ability to customize their working environment. Providing this functionality can be an expensive exercise, however, so you will want to carefully evaluate the benefit before including it.

 

 

30

 

VU CS403- DATABASE MANAGEMENT SYSTEMS FINALTERM Solved Unsolved Past Papers Fall 2012

VU CS401- Computer Architecture and Assembly Language Programming FinalTerm solved unsolved past papers Fall 2012

VU CS401- Computer Architecture And Assembly Language Programming FinalTerm Solved Unsolved Past Papers Fall 2012

CS401- Computer Architecture and Assembly

 
 

Language Programming

JULY 04 ,2012
 

Solved subjective From Final term Papers

 
       

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Fall 2012

 

 

 

Q1. Define Stack Data Structure? 2 marks Answer:- (Page 67)

 

Stack is a data structure that behaves in a first in last out manner. It can contain many elements and there is only one way in and out of the container. When an element is inserted it sits on top of all other elements and when an element is removed the one sitting at top of all others is removed first

 

Q2. How many broad categories video services are classified? 2 marks Answer:- (Page 149)

Video services are classified into two broad categories; graphics mode services and text mode services.

 

Q3. What is programmer view of processor? 2 marks Answer:- (Page 32)

The processor will blindly go there, where we mention even if it contains data and not code

 

Q4. INT-14-Serial-READ CHARACTER FORM PORT uses which two 8-bit registers to return to result? 2 marks

 

Answer:- (Page 172)

Return:

 

AH = line status

 

AL = received character if AH bit 7 clear

 

Q5. Difference between two instructions?       3 Marks

mov byte [num1],5

mov word [num1],5

Answer:-

 

In first instruction, The variable num1 is treated as a byte and similarly 5 is also treated as byte. In 2nd instruction, The variable num1 is treated as a word and similarly 5 is also treated as word.

 

1

 

Q6. Write two different modes of video services of BIOS? Differentiate between both modes? 3 Marks Answer:- (Page 149)

 

Video services are classified into two broad categories; graphics mode services and text mode services. In graphics mode a location in video memory corresponds to a dot on the screen. In text mode this relation is not straightforward. The video memory holds the ASCII of the character to be shown and the actual shape is read from a font definition stored elsewhere in memory

 

Q7. Define Triple Fault? 3 Marks  
Q8. Difference between roles of segment-selector and segment-descriptor? 3 Marks

Answer:- (Page 175)

 

Role of selector is to select on descriptor from the table of descriptors and the role of descriptor is to define the actual base address.

 

Q9. How value of Stack pointer (SP) changes after every PUSH or POP instructions? 5 Marks Answer:- (Page 68)

 

Whenever an element is pushed on the stack SP is decremented by two and when we pop from it, it increments by 2 as in case of decrementing stack. A decrementing stack moves from higher addresses to lower addresses as elements are added in it

 

Q10. How to write disk sector using INT 13 service?          5 Marks

Answer:- (Page 156)

INT 13 – DISK – WRITE DISK SECTOR(S)

 

AH = 03h

AL = number of sectors to write (must be nonzero)

CH = low eight bits of cylinder number

CL = sector number 1-63 (bits 0-5)

high two bits of cylinder (bits 6-7, hard disk only)

DH = head number

DL = drive number (bit 7 set for hard disk)

ES:BX -> data buffer

Return:

CF = error flag

AH = error code

 

AL = number of sectors transferred

 

Q11. Write down instructions for data movement and arithmetic operations in Motorola 68K Processor? 5 Marks

 

Answer:- (Page 191)

 

Data Movement EXG D0, D2 MOVE.B (A1), (A2)

MOVEA (2222).L, A4

 

2

 

MOVEQ #12, D7

Arithmetic

ADD D7, (A4)

CLR (A3) (set to zero)

CMP (A2), D1

ASL, ASR, LSL, LSR, ROR, ROL, ROXL, ROXR (shift operations)

 

Q12. How to load program using INT21 service?           5 Marks

Answer:- (Page 165)

INT 21 – LOAD AND/OR EXECUTE PROGRAM

 

AH = 4Bh

AL = type of load (0 = load and execute)

DS:DX -> ASCIZ program name (must include extension)

 

ES:BX -> parameter block

Return:

CF = error flag

AX = error code

 

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Fall 2012

 

 

 

Difference between serial and parallel communication. Answer:- (Page 171)

 

Serial port is a way of communication among two devices just like the parallel port. The basic difference is that whole bytes are sent from one place to another in case of parallel port while the bits are sent one by one on the serial port in a specially formatted fashion.

 

Write brief about INT 13 – Extended READ SERVICES

 

Answer:-(Page 157)

INT 13 – INT 13 Extensions – EXTENDED READ

AH = 42h

 

DL = drive number

DS:SI -> disk address packet

Return:

CF = error flag

AH = error code

 

 

3

 

Describe briefly INT 3 functionality. Answer:- (Page 133)

 

INT 3 is a Debug Interrupt. INT 3 has a single byte opcode so it can replace any instruction. This allows it to replace any instruction whatsoever. This is also called break point interrupt.

 

How to create or Truncate File using INT 21 Service?

Answer:- (Page 161)

INT 21 – CREATE OR TRUNCATE FILE

AH = 3Ch

 

CX = file attributes

DS:DX -> ASCIZ filename

Return:

 

CF = error flag

AX = file handle or error code

 

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Fall 2012

 

 

 

Q1) define condition when ZF is set or clear? 2 marks Answer:- (Page 41)

 

When the source is subtracted from the destination and both are equal the result is zero and therefore the zero flag is set.

 

Q2) types of User descriptor?

 

Q3) system descriptor?

Answer:-(Page 182)

The S bit tells that this is a system descriptor

 

Q4) define interrupt INT 0*80 Answer:- (Page 145)

int 0x80 ; multitasking kernel interrupt

 

 

 

 

 

 

4

 

 

Q5) draw serial port connector? 5marks

Answer:-(Page 171)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Q6) define extended ADD with carry? 5 marks Answer:- (Page 57)

 

The instruction is ADC or “add with carry.” Normal addition has two operands and the second operand is added to the firstoperand. However ADC has three operands. The third implied operand is the carry flag. The ADC instruction is specifically placed for extending the capability of ADD. Numbers of any size can be added using a proper combination of ADD and ADC. ADC first adds the carry flag to AX and then adds BX to AX. Therefore the last carry is also included in the result.

 

 

 

Q7) data movement? 5 marks Answer:- (Page 13)

 

These instructions are used to move data from one place to another. These places can be registers, memory, or even inside peripheral devices. Some

 

examples are: mov ax, bx lad 1234

 

 

 

 

 

 

 

 

 

5

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Fall 2012

 

Q- What is speed of multitasking? Answer:- (Page 143)

 

When new threads are added, there is an obvious slowdown in the speed of multitasking. To improve that, We can change the timer interrupt frequency. The following can be used to set to an approximately 1ms interval.

 

mov ax, 1100 out 0x40, al mov al, ah out 0x40, al

 

This makes the threads look faster. However the only real change is that the timer interrupt is now coming more frequently

 

Q- What is the function of ES and DS in video mode? Answer:- (Page 81)

 

Both DS and ES can be used to access the video memory. However we commonly keep DS for accessing our data, and load ES with the segment of video memory.

 

Q-Device drivers and its routine Answer:- (Page 166)

 

Device drivers are operating system extensions that become part of the operating system and extend its services to new devices.

 

Q-INT 13 Read sector into memory Answer:- (Page 156)

 

INT 13 – DISK – READ SECTOR(S) INTO MEMORY AH = 02h

 

AL = number of sectors to read (must be nonzero) CH = low eight bits of cylinder number

 

CL = sector number 1-63 (bits 0-5)

 

high two bits of cylinder (bits 6-7, hard disk only) DH = head number

 

DL = drive number (bit 7 set for hard disk) ES:BX -> data buffer

 

Return:

 

CF = error flag AH = error code

AL = number of sectors transferred

 

6

 

Q-SCAS instruction? How it checks null string? Answer:- (Page 92,95)

 

SCAS compares a source byte or word in register AL or AX with the destination string element addressed by ES:DI and updates the flag. We use SCASB with REPNE and a zero in AL to find a zero byte in the string. In CX we load the maximum possible size, which are 64K bytes.

 

 

 

Q-Function of 9 pin DB 9 Connectors? Answer:- (Page 171)

1 – Carrier Detect

 

2 – Received Data

3 – Transmitted

 

4 – Data Terminal Ready

5 – Signal Ground

6 – Data Set Ready

7 – Request to Send

8 – Clear to Send

9 – Ring Indicator

 

Q-What flags are used in AND operation

Answer:-

Affected Flag of AND are:

 

CF, OF, PF, SF, ZF and AC.

 

Q-What do you mean by calling conventions? Answer:- (Page 187)

 

To interface an assembly routine with a high level language program means to be able to call functions back and forth. And to be able to do so requires knowledge of certain behavior of the HLL when calling functions. This behavior of calling functions is called the calling conventions of the language. Two prevalent calling conventions are the C calling convention and the Pascal calling convention.

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

Fall 2012

 

Q No 1: Why we say that stack behaves like LIFO? (Marks 2) Answer:-

 

Because the structure of stack is based on first in last out. The value which we push last on the stack should be pop first.

 

7

 

 

Q No2: What are the services provided by INT 0x18? (Marks 2)

 

Q No3: Which register’s used by “INT 21-CREATE OR TRUNCATE FILE” to read service number and file attributes? (Marks 2)

 

Answer:-

AH = 3Ch

 

CX = file attributes DS:DX -> ASCIZ filename

 

Q No4: What do you mean by faulty instruction? (Marks 2)

 

Q No 5: Which instructions are to call a subroutine and to get back to the same point where the function was called? Explain these instruction with help of an Examples.(Marks 3)

 

Answer:- (Page 64)

 

CALL is used to call a subroutine and to get back RET is used. CALL takes a label as argument and execution starts from that label, until the RET instruction is encountered and it takes execution back to the instruction following the CALL.

 

FOR EXAMPLE: [org 0x0100] jmp start

num: dw 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20

 

sum: add dx, [num+bx] add bx,2

 

cmp bx,40 jne sum ret

 

start: mov dx,0 mov bx,0

 

call sum

 

mov ax,0x4c00 int 0x21

 

 

 

 

Q No6: With reference to the multitasking program” TSR Caller” writes against each instruction what they do. (Marks 3)

 

MOVE al, [chars+bx] Move [es: 40], al

 

INC bx

 

 

8

 

Answer:- (Page 146)

MOVE al, [chars+bx]

It will read next character from the declared variable char.

 

Move [es: 40], al

Answer: It will print the data at the specified place

 

INC bx

Answer: It will increment the register bx by 1

 

Q No7: Consider the function “int divide (int divided, int divisor)” declared in C, write the code to call this function from assembly language? (Marks 3)

 

Answer:- (Page 187)

 

To call this function from assembly we have to write. push dword [mydivisor]

 

push dword [mydividend] call _divide

 

add esp, 8

; EAX holds the answer

 

 

 

Q No 8: How many type of Granularity are there? (Marks 3) Answer:- click here for detail

 

In particular two types of granularity have been delineated aggregation and abstraction.

 

Q No 9: Write an assembly language program that clears the computer screen? (marks 5)

Answer:- (Page 82)    
; clear the screen    
[org 0x0100]    
mov ax, 0xb800 ; load video base in ax
mov es, ax ; point es to video base
mov di, 0 ; point di to top left column
nextchar: mov word [es:di], 0x0720 ; clear next char on screen
add di, 2 ; move to next screen location
cmp di, 4000 ; has the whole screen cleared
jne nextchar ; if no clear next position
mov ax, 0x4c00 ; terminate program  
int 0x21    

 

 

 

 

 

 

 

 

9

 

 

Q No 10: Write an assembly language program for drawing a line in graphic mode of video service? (Marks 5)

 

Answer:- (Page 152)

 

; draw line in graphics mode [org 0x0100]

 

mov ax, 0x000D ; set 320×200 graphics mode int 0x10 ; bios video services

 

mov ax, 0x0C07 ; put pixel in white color xor bx, bx ; page number 0

 

mov cx, 200 ; x position 200 mov dx, 200 ; y position 200

 

l1: int 0x10 ; bios video services dec dx ; decrease y position

 

loop l1 ; decrease x position and repeat mov ah, 0 ; service 0 – get keystroke int 0x16 ; bios keyboard services

 

mov ax, 0x0003 ; 80×25 text mode int 0x10 ; bios video services

 

mov ax, 0x4c00 ; terminate program int 0x21

 

 

 

Q No 11: Write down the movement instruction for SUN SPARK processor? Provide at least two examples? (Marks 5)

 

Answer:- (Page 193)

Data Movement

 

LDSB [rn], rn (load signed byte) LDUW [rn], rn (load unsigned word) STH [rn], rn (store half word)

 

 

 

Q No12: What are the different registers setting values required to initialize the serial port? (Marks 5) Answer:- rep

 

 

 

 

 

 

 

 

 

 

 

 

 

10

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Fall 2012

 

Sun Spark Properties? 5 Answer:- (Page 192)

 

SPARC stands for Scalable Processor Architecture. SPARC is a 64bit processor. It byte order is user settable and even on a per program basis. There are 8 global registers and 8 alternate global registers. One of them is active at a time and accessible as g0-g7.SPARC introduces a concept of register window. One window is 24 registers and the active window is pointed to by a special register called Current Window Pointer (CWP).

 

DB 9 Connect Diagram? 5

Answer:- rep

 

Base Register Function?5 Answer:- (Page 35)

 

A base register is used in brackets and the actual address accessed depends on the value contained in that register. For example “mov [bx], ax” moves the two byte contents of the AX register to the address contained in the BX register in the current data segment. The instruction “mov [bp], al” moves the one byte content of the

AL register to the address contained in the BP register in the current stack segment.

 

Chargen Services Attributes? 5

Answer:- (Page 150)

INT 10 – VIDEO – GET FONT INFORMATION

 

AX = 1130h

BH = pointer specifier

Return:

ES:BP = specified pointer

CX = bytes/character of on-screen font

DL = highest character row on screen

 

Difference SHR&SAR? 2 Answer:- (Page 150)

The sign bit is NOT retained in SHR operation while in SAR The sign bit is retained.

 

Imported and exported symbols in NASM? 2 Answer:- (Page 189)

 

In NASM an imported symbol is declared with the extern directive while and exported symbol is declared with the global directive.

 

Int 21 Create or Truncate File? 3

Answer:- rep

 

11

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Fall 2012

 

What is CALL instruction work? Answer:- (Page 64)

 

CALL takes a label as argument and execution starts from that label, until the RET instruction is encountered and it takes execution back to the instruction following the CALL. The RET works regardless of the CALL and the CALL works regardless of the RET.

 

SUN SPARC processor……three basic characteristics.

 

Answer:- rep

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2011

 

Define the multitasking

(2)

Answer:- Click here for detail

Multitasking is processing multiple tasks at one time

 

Define the protected mode (3) Answer:- (Page 175)

 

Switching processor in the newer 32bit mode is a very easy task. Just turn on the least significant bit of a new register called CR0 (Control Register 0) and the processor switches into 32bit mode called protected mode.

 

What is disk driver and why disk driver are necessary in BIOS (5) Answer:- (Page 156)

 

BIOS disk services used to directly see the data stored in the directory entries by DOS. For this purpose we will be using the BIOS disk services.

 

Writ the code of break point interrupt routine  (5)

Answer: Page 136 (Example 10.2)

 

Define the trap flag (3) Answer:- (Page 133)

 

If the trap flag is set, the after every instruction a type 1 interrupt will be automatically generated. This is like the divide by zero interrupt which was never explicitly invoked but it came itself.

 

12

 

From what purpose INT 1 is reserved (2) Answer:- (Page 105)

 

This interrupt is used in debugging with the trap flag. If the trap flag is set the Single Step Interrupt is generated after every instruction. By hooking this interrupt a debugger can get control after every instruction and display the registers etc.

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2011

 

 

Write two examples of Instructions relating data movement used in “sun SPARK Processor”. (2 Marks)

Answer:- rep

 

When we multiply two 8 bit numbers, in how many bits there answer will be? (2 Marks) Answer:-

 

16 bit

 

What is trap flag? (2 Marks)

Answer:- rep

 

Define serial port? (2 Marks)

Difference between serial and parallel communication.

Answer:- (Page 171)

Serial port is a way of communication among two devices just like the parallel port

 

How to reset disk file system using INT 13 Disk Rest services? (3 Marks)

Answer:- (Page 156)

INT 13 – DISK – RESET DISK SYSTEM

 

AH = 00h

DL = drive

 

Return:

CF = error flag

AH = error code

 

Why IF & TF are cleared? (3 Marks) Answer:- (Page 133)

 

The interrupt mechanism automatically clears IF and TF otherwise there would an infinite recursion of the single step interrupt. The TF is set in the flags on the stack so another interrupt will comes after one more instruction is executed after the return of the interrupt.

 

13

 

Describe “Indexed Register Indirect + offset” addressing mode with example? (3 Marks)

Answer:- (Page 136)

 

An index register is used with a constant offset in this addressing mode. The value contained in the index register is added with the constant offset to get the effective address. For example “mov [si+300], ax” moves the word contained in AX to the offset attained by adding 300 to SI in the current data segment and the instruction “mov [di+300], al” moves the byte contained in AL to the offset attained by adding 300 to DI in the current data segment.

 

 

 

Write the algorithm of bubble sort in your words? (5 Marks) Answer:- (Page 46)

 

In this algorithm we compare consecutive numbers. If they are in required order e.g. if it is a descending sort and the first is larger then the second, then we leave them as it is and if they are not in order, we swap them. Then we do the same process for the next two numbers and so on till the last two are compared and possibly swapped.

 

List only five BIOS video services used in text mode? (5 Marks)

Answer:- (Page 149)

INT 10 – VIDEO – SET TEXT-MODE CURSOR SHAPE

 

INT 10 – VIDEO – SET CURSOR POSITION

INT 10 – VIDEO – SCROLL UP WINDOW

INT 10 – VIDEO – SCROLL DOWN WINDOW

INT 10 – VIDEO – WRITE STRING

 

Write main characteristic of SUN SPARK Processor? (5 Marks)

Answer:- rep

 

Write the code of “break point Interrupt routine”. (5 Marks)

Answer:- rep

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

14

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2011

 

 

1. Define multitasking?   3 marks

Answer:- rep

 

2. What is the function of selector and descriptor?        3 marks

Answer:- rep

 

4 what is the difference in Motorola 64 k and x86 processors? 5 marks Answer:- (Page 191)

 

The instructions are very similar however the difference in architecture evident. 68K processors have 16 23bit general purpose registers named from A0-A7 and D0-D7. A0-A7 can hold addresses in indirect memory accesses. These can also be used as software stack pointers. Stack in 68K is not as rigit a structure as it is in x86.

 

5. Which register is called a scratch register? 2 marks Answer:- (Page 187)

EAX, ECX, EDX, FS, GS, EFLAGS, and any other registers.

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2011

 

What is scheduler

Answer:- (Page 141)

INT 08 that is saving and restoring the registers is called the scheduler.

 

VESA INT 10 service

Answer:- (Page 180)

INT 10 – VESA – Get SuperVGA Infromation

 

INT 10 – VESA – Get SuperVGA Mode Information

INT 10 – VESA – Set VESA Video Mode

 

Draw the DB-9 pin Connector and writ each PIN

Answer:- rep

 

15

 

What is Stack overflow Answer:- (Page 187)

 

The strong argument in favour of callee cleared stacks is that the arguments were placed on the stack for the subroutine, the caller did not needed them for itself, so the subroutine is responsible for removing them. Removing the arguments is important as if the stack is not cleared or is partially cleared the stack will eventually become full, SP will reach 0, and thereafter wraparound producing unexpected results. This is called stack overflow.

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

 

FINALTERM EXAMINATION

Spring 2011

 

Difference between naming conversion of C language & Pascal (5). Answer:- (Page 187)

 

C pretends an underscore to every function or variable name while Pascal translates the name to all uppercase. C++ has a weird name mangling scheme that is compiler dependent. To avoid it C++ can be forced to use C style naming with extern “C” directive.

 

Difference between Data Bus & Control bus (5). Answer:- (Page 9)

 

Data bus is used to move the data from the memory to the processor in a read operation and from the processor to the memory in a write operation. While one line of the bus is used to inform the memory about whether to do the read operation or the write operation. These lines are collectively known as the control bus

 

Define protected mode (3)

Answer:- rep

 

In what order C & Pascal instruction are passed to routines. (3). Answer:- (Page 187)

 

In C parameters are pushed in reverse order with the rightmost being pushed first. While in Pascal they are pushed in proper order with the leftmost being pushed first.

 

Describe Debugger in the term of Trap Flag (5). Answer:- (Page 133)

 

If the trap flag is set, the after every instruction a type 1 interrupt will be automatically generated. The debugger is made using this interrupt. It allows one instruction to be executed and then return control to us. It has its display code and its code to wait for the key in the INT 1 handler. Therefore after every instruction the values of all registers are shown and the debugger waits for a key.

 

 

 

16

 

Define Multithreading (3).

Answer:- rep

 

What the processor vision about video devices. (3). Answer:- (Page 80)

 

The video device is seen by the computer as a memory area containing the ASCII codes that are currently displayed on the screen and a set of I/O ports controlling things like the resolution, the cursor height, and the cursor position.

 

lds si, [bp+4] from DS and SI will load? (2) Answer:- (Page 97)

lds si, [bp+4]” will load SI from BP+4 and DS from BP+6.

 

What is processor control block answer in one line (2). Answer:- (Page 140)

The space where all registers of a task are stored is called the process control block or PCB.

 

Name the five video text mode of BIOS only list (5).

Answer:- rep

 

 

 

 

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2011

 

 

 

Define context switching 2 marks Answer:- (Page 141)

 

INT 08 that is saving and restoring the registers is called the scheduler and the whole event is called a context switch.

 

Make Diagram of Serial port and give pin names. 5 marks

Answer:- rep

 

3 common services given by video text mode. 2 marks Answer:- rep

 

 

 

17

 

Format of the interrupt descriptor

Answer:- (Page 182)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

 

FINALTERM EXAMINATION

Spring 2011

 

 

  1. 1.  Define Faulty Instructions [3maks]

 

  1. 2.  Define Protected mode [3 marks] Answer:- rep

 

3a. What are the ranges of addressable memory in protected mode?

 

  1. 5.  Define Device drivers. Why device drivers are used when BIOS already have all available codes. write its need[5marks]

Answer:- (Page 166)

 

Device drivers are operating system extensions that become part of the operating system and extend its services to new devices. Device drivers in DOS are very simple. They just have their services exposed through the file system interface.

 

  1. 6.  Write Bubble sort algorithm in your own words. [5 marks]

Answer:- rep

 

 

 

18

 

  1. 7.  Fill in the blanks with proper words[solved] [5 marks] Answer:- (Page 150)

AH = -09h —

 

AL = — character to display — BH = – page number —

 

BL = — attribute —

CX =— number of times to write character –

 

(09h, page number, number of times to write character, attribute ,character to display,)

 

 

  1. 8.  How can we increase speed of multitasking process? [2marks]

Answer:- rep

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2011

 

Qno.41 How cam we improve the spec of the multitasking? (2)

Answer:- rep

 

Qno.42 What do you mean by data label and code label? (2) Answer:- (Page 32)

 

Labels can be used on code as well. Just like data labels they remember the address at which they are used. The assembler does not differentiate between code labels and data labels. The programmer is responsible for using a data label as data and a code label as code.

 

Qno.43 What is system descriptor? (2)

Answer:- rep

 

Qno.44 What are device driver, Give your answer in two or three lines (2)

 

Answer:- rep

 

Qno.45 In what order the parameters are passed to routine in Pascal and C Language (3) Answer:- rep

 

Qno.46 What is multitasking (3)

Answer:- rep

 

 

 

 

19

 

Qno.47 Difference between wraparound and physical wraparound and physical wraparounds

 

Qno.49 How to load AND/ OR execute program using INT 21 services (5)

Answer:- (Page 165)

INT 21 – LOAD AND/OR EXECUTE PROGRAM

 

AH = 4Bh

AL = type of load (0 = load and execute)

DS:DX -> ASCIZ program name (must include extension)

ES:BX -> parameter block

Return:

CF = error flag

AX = error code

 

Qno.50 Describe the format of interrupt descriptor (5)

Answer:- rep

 

Qno.51 Following piece of code is taken from the program of scrolling up the screen write against each instruction what it does (5)

 

Mov ax 80

Mu byte [bp+4]

Mov si, ax

Push si

Shl si1

 

Answer:- (Page 150)

mov ax, 80 ; load chars per row in ax

 

mul byte [bp+4] ; calculate source position mov si, ax ; load source position in si push si ; save position for later use

shl si, 1 ; convert to byte offset

 

Qno.52 In context of video service write character and attribute at cursor position using INT 10 pick up correct statement given between and put it is proper blank spaces

 

AH…………………………………………….

AL…………………………………………….

BH…………………………………………….

BL…………………………………………….

CX…………………………………………….

(5)

*

 

Answer:- rep

 

20

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Fall 2011

 

Question No: 42 ( Marks: 2 ) –

INT 14 – SERIAL – READ CHARACTER 8 bit register return result in?

Answer:- (Page 172)

Return:

 

AH = line status

AL = received character if AH bit 7 clear

 

Question No: 43 ( Marks: 2 ) –

What is the process control back answer in single line

Answer:- rep

 

Question No: 44 ( Marks: 2 ) – Explain Divide overflow Answer:- (Page 85)

 

If a large number is divided by a very small number it is possible that the quotient is larger than the space provided for it in the implied destination. In this case an interrupt is automatically generated and the program is usually terminated as a result. This is called a divide overflow error;

 

Question No: 45 ( Marks: 2 )

What is the system descriptor?

Answer:- rep

 

Question No: 46 ( Marks:3 )

 

It is the part of Multitasking TSR caller, what will do these instructions comment against them

 

Mov al, [chars+bx] Mov [es:40],al

 

Inc bx Answer:- rep

 

Question No: 48 ( Marks:3 )

 

Three basic steps B/w memory and processor to communicate. Answer:- (Page 9)

 

The group of bits that the processor uses to inform the memory about which element to read or write is collectively known as the address bus. Another important bus called the data bus is used to move the data from the memory to the processor in a read operation and from the processor to the memory in a write operation. The third group consists of miscellaneous independent lines used for control purposes.

 

21

 

Question No: 49 ( Marks:3 )

 

What is baud rate, tell the parity bit function. Answer:- (Page 171)

 

The data starts with a 1 bit called the start bit, then five to eight data bits, an optional parity bit, and one to two 0 bits called stop bits.

 

The number of data bits, parity bits, and the number of stop bits have to be configured at both ends. Also the duration of a bit must be precisely known at both ends called the baud rate of the communication.

 

 

Question No: 50 ( Marks:5 )

Write the instruction of following

Copy BL into CL

Answer: mov cl, bl

 

Copy DX into AX

Answer: mov ax, dx

 

Store 0x12 into AL

Answer: mov al, 0x12

 

Store 0x1234 into AX

Answer: mov ax, 0x1234

 

Store 0xFFFF into AX

Answer: mov ax, 0xFFFF

 

 

Question No: 51 ( Marks:5 )

 

9 pin DB9 connector , write function of any five Answer:- rep

 

Question No: 52 ( Marks:5 )

 

Fill in the blanks with proper words AH =

 

AL =

BH =

BL =

CX =

 

(09h, page number, number of times to write character, attribute ,character to display,) Answer:- rep

 

 

 

 

 

22

 

Question No: 52 ( Marks:5 )

Fill in the blanks with proper words

 

The GDT itself is an array of descriptors where each descriptor is an 8byte entry. The base and limit of GDT is stored in a 48bit register called the GDTR.

 

This register is loaded with a special instruction LGDT and is given a memory address from where the 48bits are fetched.

 

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2010

 

Question No: 27   ( Marks: 2 )

How can we improve the speed of multitasking?

Answer:- rep

 

Question No: 28   ( Marks: 2 )

 

Write instructions to do the following. Copy contents of memory location with offset 0025 in the current data segment into AX.

 

Answer:-

Mov ax , [0025]

 

Question No: 29   ( Marks: 2 )

 

Write types of Devices? Answer:- Click here for detail

 

The four types of computer devices are:-

  1. input devices
  2. output devices
  3. storage devices and
  4. The central processing unit i.e. C.P.U.

 

Question No: 30   ( Marks: 2 )

 

What dose descriptor 1st 16 bit tell?

 

Question No: 31   ( Marks: 3 )

List down any three common video services for INT 10 used in text mode.

Answer:- rep

 

 

 

23

 

Question No: 32   ( Marks: 3 )

How to create or Truncate File using INT 21 Service?

 

Answer:- rep

 

Question No: 33   ( Marks: 3 )

How many Types of granularity also name them?

 

Answer:-  Click here for detail

There are three types of granularity :

  1. Data Granularity
  2. Business Value Granularity
  3. Functionality Granularity

 

Question No: 34   ( Marks: 5 )

How to read disk sector into memory using INT 13 service?

 

Answer:- rep

 

Question No: 35   ( Marks: 5 )

 

The program given below is written in assembly language. Write a program in C to call this assembly routine.

 

[section .text]    
global swap    
swap: mov ecx,[esp+4] ; copy parameter p1 to ecx
  mov edx,[esp+8] ; copy parameter p2 to edx
  mov eax,[ecx] ; copy *p1 into eax
  xchg eax,[edx] ; exchange eax with *p2
  mov [ecx],eax ; copy eax into *p1
  ret   ; return from this function

 

Answer:- (Page 189)

#include <stdio.h>

 

void swap( int* p1, int* p2 ); int main()

 

{

 

int a = 10, b = 20;

 

printf( “a=%d b=%d\n”, a, b ); swap(&a, &b );

 

printf( “a=%d b=%d\n”, a, b ); system( “PAUSE” );

 

return 0;

}

 

 

 

 

24

 

Question No: 36   ( Marks: 5 )

Write the code of “break point interrupt routine”.

 

Answer:- rep

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2010

 

Question No: 27   ( Marks: 2 )

What are device drivers? give your answer in two to three lines.

 

Answer:- rep

 

Question No: 28   ( Marks: 2 )

For what purpose “INT 1” is reserved ?

 

Answer:- rep

 

Question No: 29   ( Marks: 2 )

How interrupts are handled in protected mode.

 

Answer:- (Page 182)

 

Handling interrupts in protected mode is also different. Instead of the IVT at physical address 0 there is the IDT (interrupt descriptor table) located at physical address stored in IDTR, a special purpose register. The IDTR is also a 48bit register similar in structure to the GDTR and loaded with another special instruction LGDT.

 

Question No: 30 ( Marks: 2 )
Which bit of acknowledge is used to generate IRQ7
Answer:- (Page 125)
Bit “4” of acknowledge is used to generate IRQ7
Question No: 31 ( Marks: 3 )

Write the name three flags which are not used for mathematical operations.

 

Answer:- (Page 133)

The three flags not used for mathematical operations are the direction flag, the interrupt flag and the trap flag.

 

Question No: 32   ( Marks: 3 )

“INT 13 – DISK – GET DRIVE PARAMETERS” uses which registers to return error flag and error number.

 

Answer:- (Page 156)

 

CF = error flag AH = error code

 

 

25

 

Question No: 33   ( Marks: 3 )

Who is responsible for removing the parameter from the stack when we call a function in C and Pascal?

Answer:- (Page 187)

 

In C the caller removes the parameter while in Pascal the callee removes them. The C scheme has reasons pertaining to its provision for variable number of arguments.

 

 

Question No: 34   ( Marks: 5 )

Read the passage carefully and choose proper word for each blank space from the list given below .

 

In descriptors the 32bit base is scattered into different places because of compatibility reasons. The limit is

stored in 20 bits but the …G………… defines that the limit is in terms of bytes of 4K pages therefore a maximum
of 4GB size is possible. The …..P…………

must be set to signal that this segment is present in memory. DPL is

the descriptor privilege level again related to the protection levels in 386. ……… D……… defines that this
segment is to execute code is 16bit mode or 32bit mode . …….C……….. is conforming bit that we will not be
using. …… R………… signals that the segment is readable.

A bit is automatically set whenever the

segment is accessed.

 

(A bit, C bit, G bit, D bit, P bit , R bit, B bit) Answer: (Page 176)

 

The 32bit base in both descriptors is scattered into different places because of compatibility reasons. The limit is stored in 20 bits but the G bit defines that the limit is in terms of bytes of 4K pages therefore a maximum of 4GB size is possible. The P bit must be set to signal that this segment is present in memory. DPL is the descriptor privilege level again related to the protection levels in 386. D bit defines that this segment is to execute code is 16bit mode or 32bit mode. C is conforming bit that we will not be using. R signals that the segment is readable. A bit is automatically set whenever the segment is accessed.

 

Question No: 35   ( Marks: 5 )

Write assembly language instructions to set the timer interrupt frequency at 1 ms.

 

Answer: (Page 143)

mov ax, 1100
out 0x40, al
mov al, ah
out 0x40, al

 

Question No: 36   ( Marks: 5 )

 

In the context of ” INT 13 – DISK – WRITE DISK SECTOR(S)” fill the blanks by choosing the correct answer against each blank space from the list given at the bottom.

 

Answer:- (Page 156)

AH = 03h

 

AL = number of sectors to write (must be nonzero) CH = low eight bits of cylinder number

 

CL = sector number 1-63 (bits 0-5)

 

26

 

high two bits of cylinder (bits 6-7, hard disk only) DH = head number

 

DL = drive number (bit 7 set for hard disk) ES:BX -> data buffer

 

(Number of sectors to write, head number , 03h, data buffer , low eight bits of cylinder number)

 

 

 

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2010

 

 

 

 

How many bytes floppy root directory entry has? (2) Answer: Click here for detail

 

224 bytes for a 3 1/2 inch floppy

 

How many calling conversion also tell the names? (2) Answer:- (Page 187)

 

Two prevalent calling conventions are the C calling convention and the Pascal calling convention.

 

 

Which register is used as thread local variable? (2)

Answer:- (Page 141)

SP (stack pointer) register used as thread local variable

 

Write down the operations of CMP instruction? (2) Answer:- (Page 39)

 

The operation of CMP is to subtract the source operand from the destination operand, updating the flags without changing either the source or the destination.

 

It is the part of Multitasking TSR caller, what will do these instructions comment against them (3) Mov al, [chars+bx]

 

Mov [es:40],al Inc bx Answer:- rep

 

 

 

 

 

27

 

Differentiate synchronous transmission and asynchronous transmission? (3) Answer:- (Page 103)

 

Asynchronous means that the interrupts occur, independent of the working of the processor, i.e. independent of the instruction currently executing. Synchronous events are those that occur side by side with another activity.

 

List some architecture? (3) Answer:-

 

iAPX88 architecture Motorolla 68K

 

x86 series architecture

SPARC stands for Scalable Processor ARChitecture

 

1. What information is required to be provided for the service “INT14-SERIAL WRITE CHARACTER TO PORT” in the following registers? (5 marks)

 

AH=___________

AL=___________

DX=___________

 

Answer:- (Page 172)

AH = 01h

 

AL = character to write

DX = port number (00h-03h)

 

2. Write into C language (5 marks)
[section.txt]    
Global swap    
swap: mov ecx,[esp+4] copy parameters p1 to ecx
  mov edx[esp+8] copy parameters p2 to edx
  mov eax,[ecx]   copy *p1 to eax
  xchg eax,[edx] exchange eax to *p2
  mov [ecx],eax   copy eax to *p1
  ret   return

 

Answer:- rep

 

3. Which instruction makes trap flag zero? If there is not any then how we make it zero? (5 marks)

 

Answer:- (Page 133)

 

There is no instruction to set or clear the trap flag like there are instructions for the interrupt and direction flags. We use two special instructions PUSHF and POPF to push and pop the flag from the stack. We use PUSHF to place flags on the stack, change TF in this image on the stack and then reload into the flags register with POPF.

 

 

 

 

 

28

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2010

 

 

 

  1. 25.  Division by zero is done by which interrupt. Answer:- (Page 105)

 

Division by zero is done by INT 0 interrupt.

 

 

 

  1. 26.  Define Hardware Interrupt & I/O ports (5 marks) Answer:- (Page 113-114)

 

Hardware interrupts

 

Hardware interrupts are the real interrupts generated by the external world. there are many devices generating interrupts and there is only one pin going inside the processor and one pin cannot be technically derived by more than one source a controller is used in between called the Programmable Interrupt Controller (PIC).

I/O ports

 

For communicating with peripheral devices the processor uses I/O ports. There are only two operations with the external world possible, read or write. Similarly with I/O ports the processor can read or write an I/O port. When an I/O port is read or written to, the operation is not as simple as it happens in memory.

 

 

  1. 27.  Five BIOS video services used in text mode ( 3 marks)

Answer:- rep

 

28. DOS allocate memory for program execution and then de-allocate , explain memory management in DOS (10 marks)

 

Answer:- (Page 121)

 

At physical address zero is the interrupt vector table. Then are the BIOS data area, DOS data area, IO.SYS, MSDOS.SYS and other device drivers. In the end there is COMMAND.COM command interpreter. The remaining space is called the transient program area as programs are loaded and executed in this area and the space reclaimed on their exit. A freemem pointer in DOS points where the free memory begins. When DOS loads a program the freemem pointer is moved to the end of memory, all the available space is allocated to it, and when it exits the freemem pointer comes back to its original place thereby reclaiming all space. This action is initiated by the DOS service 4C. The second method to legally terminate a program and give control back to DOS is using the service 31. Control is still taken back but the memory releasing part is modified. A portion of the allocated memory can be retained. So the difference in the two methods is that the freemem pointer goes back to the original place or a designated number of bytes ahead of that old position.

 

 

 

 

29

 

There was fill in blanks question with 10 marks. The choice was given at bottom.

 

29. Serial Port is also accessible via ______ ports , _________ is accessible via ports 3F8-3FF while

_______ is accessible via 2F8 -2FF.

 

The first register at 3F8 is the _________ holding register if written to and the receiver ______ register if read from.

 

Other register of our interest include 3F9 whose ______ must be set to enable received data available interrupt and ________ must be set to enable transmitter holding register empty interrupt.

 

( Transmitter , COM 1 , I/O ports , COM2. bit 0 , Buffer , 3FA) Answer:- (Page 172)

 

Serial port is also accessible via I/O ports. COM1 is accessible via ports 3F8-3FF while COM2 is accessible via 2F8-2FF. The first register at 3F8 (or 2F8 for the other port) is the transmitter holding register if written to and the receiver buffer register if read from. Other registers of our interest include 3F9 whose bit 0 must be set to enable received data available interrupt and bit 1 must be set to enable transmitter holding register empty interrupt.

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2010

 

 

 

Q no 41 Write down purpose of JNZ instruction? (2) Answer:- (Page 32)

 

The JNZ instruction is from the program control group and is a conditional jump, meaning that if the condition NZ is true (ZF=0) it will jump to the address mentioned and otherwise it will progress to the next instruction.

 

Q no 42 How many bytes floppy root directory entry has? (2)

Answer:- rep

 

Q no 43 Write the programmer view of processor? (2)

Answer:- rep

 

Q no 44 What is scheduler? (2)

Answer:- rep

 

Q no 45 Write the names of any two descriptor? (3)

Answer:- rep

 

Q no 46 Define the protected mode? (3)

Answer:- rep

 

 

30

 

Q no 47 Write the algorithm of multiplication of two 4 bits number? (3) Answer:- (Page 51)

 

We take the first digit of the multiplier and multiply it with the multiplicand. As the digit is one the answer is the multiplicand itself. So we place the multiplicand below the bar. Before multiplying with the next digit a cross is placed at the right most place on the next line and the result is placed shifted one digit left.

 

Q no 48 How threads are register in the scheduler? (3)

 

Q no 49 INT 14 serial with character to port (5)

AH=………………

AL=……………..

AX=………………

Answer:- rep

 

Q no 50 Define the debugger. How to run the debugger tell the command, and all its parts? (5) Answer:-

 

A debugger is a computer program that lets you run your program, line by line and examine the values of variables or look at values passed into functions and let you figure out why it isn’t running the way you expected it to.

 

We can run debugger by pressing F1 and F2.The debugger shows the values of registers, flags, stack, our code, and one or two areas of the system memory as data. Debugger allows us to step our program one instruction at a time and observe its effect on the registers and program data.

 

Q no 51 Write the code of “break point interrupt routine”? (5)

Answer:- rep

 

Q no 52 Describe the format of interrupt descriptor? (5)

Answer:- rep

 

 

 

 

 

CS401- Computer Architecture and Assembly Language Programming

FINALTERM EXAMINATION

 

Spring 2010

 

 

Question No: 27   ( Marks: 2 )

 

Write instruction to allocate space for 32 PCBs. Answer:- (Page 141)

pcb: times 32*16 dw 0 ; space for 32 PCBs

 

 

 

 

31

 

Question No: 28   ( Marks: 2 )

Define short jump

 

Answer:- (Page 46)

 

If the offset is stored in a single byte as in 75F2 with the opcode 75 and operand F2, the jump is called a short jump.

 

Question No: 29   ( Marks: 2 )

INT 14 – SERIAL – READ CHARACTER FROM PORT uses which two 8bit registers to return the results ?

 

Answer:- rep

 

Question No: 30   ( Marks: 2 )

Which registers are uses as scratch when we call a function?

 

Answer:- rep

 

Question No: 31   ( Marks: 3 )

VESA service “INT 10 VESA Get SuperVGA Information” uses which registers to return the result?

 

Answer:- (Page 180)

To return the result, “INT 10 – VESA – Get SuperVGA Information” uses:

 

Return:

 

AL = 4Fh if function supported AH = status

 

Question No: 32   ( Marks: 3 )

Define the protected mode.

 

Answer:- rep

 

Question No: 33   ( Marks: 3 )

Describe briefly INT 3 functionality.

 

Answer:- rep

 

Question No: 34   ( Marks: 5 )

Read the passage carefully and choose proper word for each blank space from the list given below .

 

In descriptors the 32bit base is scattered into different places because of compatibility reasons. The limit is

stored in 20 bits but the ……………

defines that the limit is in terms of bytes of 4K pages therefore a maximum of

4GB size is possible. The……………..

must be set to signal that this segment is present in memory. DPL is the

descriptor privilege level again related to the protection levels in 386. ……………… defines that this segment is to
execute code is 16bit mode or 32bit mode. ……………… is conforming bit that we will not be using.

………………signals that the segment is readable. A bit is automatically set whenever the segment is accessed.

 

(A bit, C bit, G bit, D bit, P bit , R bit, B bit) Answer:- rep

 

 

 

 

32

 

Question No: 35   ( Marks: 5 )

Answer the following:

 

  • What is a device driver?

 

Answer:- rep

 

  • Why are device drivers necessary, given that the BIOS already has code that communicates with the computer’s hardware?

 

Answer:- rep

 

Question No: 36   ( Marks: 5 )

Write the code of “break point interrupt routine”.

 

Answer:- rep

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

33

 

VU CS401- Computer Architecture And Assembly Language Programming FinalTerm Solved Unsolved Past Papers Fall 2012

Education In Pakistan © 2016