NOTES FOR COMPUTER OGANISATION AND ARCTECTURE, Schemes and Mind Maps of Database Management Systems (DBMS)

351CS31 – COMPUTER ORGANIZATION AND ARCHITECTURE Explain the concept and real time uses of the various C++ file I/O classes and functions

Typology: Schemes and Mind Maps

2022/2023

Uploaded on 04/26/2023

marvin-malunga
marvin-malunga 🇿🇲

1 document

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
INSTITUTE OF VIRTUAL AND DISTANCE LEARNING
9 miles, Great North Road, Zambia
NAME : MARVIN MALUNGA McNight
REGISTER NUMBER : 22293351402
CENTRE CODE&NAME : 04 & KITWE
PROGRAMME : BSC IN COMPUTER SCIENCE
SEMESTER : 3
MODULE CODE&NAME : 315 CS31 & COMPUTER ORGANIZATION AND ARCHITECTURE
ASSIGNMENT NUMBER : ASSIGNMENT I
DATE OF SUBMISSION : 30TH September, 2022
DMI – ST.EUGENE
UNIVERSITY
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download NOTES FOR COMPUTER OGANISATION AND ARCTECTURE and more Schemes and Mind Maps Database Management Systems (DBMS) in PDF only on Docsity!

INSTITUTE OF VIRTUAL AND DISTANCE LEARNING

9 miles, Great North Road, Zambia

NAME : MARVIN MALUNGA McNight

REGISTER NUMBER : 22293351402

CENTRE CODE&NAME : 04 & KITWE

PROGRAMME : BSC IN COMPUTER SCIENCE

SEMESTER : 3

MODULE CODE&NAME : 315 CS31 & COMPUTER ORGANIZATION AND ARCHITECTURE

ASSIGNMENT NUMBER : ASSIGNMENT I

DATE OF SUBMISSION : 30

TH

September, 2022

DMI – ST.EUGENE

UNIVERSITY

Table of Contents

  • ASSIGNMENT I.............................................................................................................................................
    • 351CS31 – COMPUTER ORGANIZATION AND ARCHITECTURE.................................................................
      • Explain the concept and real time uses of the various C++ file I/O classes and functions...................
  • The various C++ file I/O classes and functions.............................................................................................
  • I/O BUS AND MEMORY BUS.........................................................................................................................
  • Asynchronous data transfer........................................................................................................................
  • COMMUNICATION INTERFACE..................................................................................................................
  • DIRECT MEMORY ACCESS (DMA)...............................................................................................................
  • SERIAL COMMUNICATION.........................................................................................................................
  • Summary...................................................................................................................................................
  1. Unit of Information  Peripherals uses Byte, Block, …  CPU or Memory uses Word 4. Data representations may differ In this case there is I/O BUS AND INTERFACE MODULES Each peripheral has an interface module associated with its Interface and this is able to; Decodes the device address (device code) Decodes the commands (operation) Provides signals for the peripheral controller Synchronizes the data flow and supervises the transfer rate between peripheral and CPU or Memory CONNECTION OF I/O BUS

The various C++ file I/O classes and functions

A C++ class is a collection of data and the methods necessary to control and maintain data. C++ supports a rich set of I/O functions and operations. These functions use the advanced features of C+

  • such as classes, derived classes, and virtual functions. It also supports all of C’s set of I/O functions and therefore can be used in C++ programs, but their use should be restrained due to two reasons. I. Methods in C++ support the concept of OOPs. II. Methods in C cannot handle the user-define data type such as class and object.  A class is a data type, analogous to ints, floats, and doubles  A C++ object is a specific variable having a class as its data type. cin and cout are special pre-specified objects with different classes as their data types It uses the concept of stream (which is a flow of data into or out of a program, such as the data written to cout or read from cin .)And stream classes to implement its I/O operations with the console and disk files. C++ Stream The I/O system in C++ is designed to work with a wide variety of devices including terminals, disks, and tape drives. Although each device is very different, the I/O system supplies an interface to the programmer that is independent of the actual device being accessed. This interface is known as the stream.  A stream is a sequence of bytes.  The source stream that provides the data to the program is called the input stream.  The destination stream that receives output from the program is called the output stream.  The data in the input stream can come from the keyboard or any other input device.  The data in the output stream can go to the screen or any other output device. C++ contains several pre-defined streams that are automatically opened when a program begins its execution. These include cin and cout. It is known that cin represents the input stream connected to the standard input device (usually the keyboard) and cout represents the output stream connected to the standard output device (usually the screen) C++ Stream Classes

Asynchronous data transfer

In a computer system, CPU and an I/O interface are designed independently of each other. When internal timing in each unit is independent from the other and when registers in interface and registers of CPU uses its own private clock. In that case the two units are said to be asynchronous to each other. CPU and I/O device must coordinate for data transfers. METHODS USED IN ASYNCHRONOUS DATA TRANSFER Strobe Control: This is one way of transfer i.e. by means of strobe pulse supplied by one of the units to indicate to the other unit when the transfer has to occur. Handshaking: This method is used to accompany each data item being transferred with a control signal that indicates the presence of data in the bus. The unit receiving the data item responds with another control signal to acknowledge receipt of the data. HANDSHAKING In case of source initiated data transfer under strobe control method, the source unit has no way of knowing whether destination unit has received the data or not. Similarly, destination initiated transfer has no method of knowing whether the source unit has placed the data on the data bus. Handshaking mechanism solves this problem by introducing a second control signal that provides a reply to the unit that initiate the transfer. There are two control lines in handshaking technique:  Source to destination unit  Destination to source unit SOURCE INITIATED TRANSFER Handshaking signals are used to synchronize the bus activities. The two handshaking lines are data valid , which is generated by the source unit, and data accepted , generated by the destination unit. The timing diagram shows exchange of signals between two units.

SOURCE INITIATED TRANSFER USING HANDSHAKING

The sequence of events: The source unit initiates the transfer by placing the data on the bus and enabling its data valid signal. The data accepted signals is activated by the destination unit after it accepts the data from the bus. The source unit then disables its data valid signal, which invalidates the data on the bus. The destination unit the disables its data accepted signal and the system goes into its initial state.

ASYNCHRONOUS SERIAL TRANSFER

Employs special bits which are inserted at both ends of the character code Each character consists of three parts; Start bit; Data bits; Stop bits. A character can be detected by the receiver from the knowledge of 4 rules; When data are not being sent, the line is kept in the 1-state (idle state) The initiation of a character transmission is detected by a Start Bit, which is always a 0 The character bits always follow the Start Bit After the last character, a Stop Bit is detected when the line returns to the 1-state for at least 1bit time The receiver knows in advance the transfer rate of the bits and the number of information bits to expect.

COMMUNICATION INTERFACE

Transmitter Register  Accepts a data byte (from CPU) through the data bus  Transferred to a shift register for serial transmission Receiver  Receives serial information into another shift register  Complete data byte is sent to the receiver register Status Register Bits  Used for I/O flags and for recording errors Control Register Bits  Define baud rate, no. of bits in each character, whether to generate and check parity, and no. of stop bits Block Diagram

DIRECT MEMORY ACCESS (DMA)

Transfer of data between a fast storage device and memory is limited by the speed of CPU Remove CPU from the path of communication and the technique is DMA DMA controller takes over the buses to manage the transfer directly between the I/O device and memory  Bus Request (BR) – used by the DMA controller to request the CPU to relinquish control of the buses  CPU activates bus grant to inform the external DMA that the buses are in high impedance state  Burst transfer – block sequence consisting of memory words is transferred in a continuous bus when DMA controller is the master  Cycle Stealing – allows DMA controller to transfer one data word at a time after which it must return control of the buses to the CPU Input Output Processor Processor with DMA capability that communicates with I/O devices IOP takes care of input and output tasks relieving the CPU from the housekeeping chores involved in I/O transfers  IOP can fetch and execute its own instructions  IOP instructions are specifically designed to facilitate I/O transfers

CPU – IO Processor Communication