0% found this document useful (0 votes)
56 views6 pages

Digital Assignment-1 Name: Ayachitula Sankar Sudheer Reg No: 18BCE0556

The document discusses computer system organization and OpenMP parallel programming. It provides details about computer system components like CPU, memory, and I/O devices. It also explains the differences between computer architecture and organization. OpenMP is then introduced as a library for parallel programming using shared memory. Key aspects of OpenMP like parallel sections, master and slave threads, and pragmas are summarized. An example OpenMP program prints the thread ID.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views6 pages

Digital Assignment-1 Name: Ayachitula Sankar Sudheer Reg No: 18BCE0556

The document discusses computer system organization and OpenMP parallel programming. It provides details about computer system components like CPU, memory, and I/O devices. It also explains the differences between computer architecture and organization. OpenMP is then introduced as a library for parallel programming using shared memory. Key aspects of OpenMP like parallel sections, master and slave threads, and pragmas are summarized. An example OpenMP program prints the thread ID.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Digital Assignment-1

Name: Ayachitula Sankar Sudheer


Reg No: 18BCE0556

1.
The computer system is a combination of many parts such as peripheral devices,
secondary memory, CPU etc. This can be explained more clearly using a diagram.

The salient points about the above figure displaying Computer System Organisation
is −

• The I/O devices and the CPU both execute concurrently. Some of the
processes are scheduled for the CPU and at the same time, some are
undergoing input/output operations.
• There are multiple device controllers, each in charge of a particular device
such as keyboard, mouse, printer etc.
• There is buffer available for each of the devices. The input and output data
can be stored in these buffers.
• The data is moved from memory to the respective device buffers by the CPU
for I/O operations and then this data is moved back from the buffers to
memory.
• The device controllers use an interrupt to inform the CPU that I/O operation is
completed.
Interrupt Handling
An interrupt is a necessary part of Computer System Organisation as it is triggered by
hardware and software parts when they need immediate attention.
An interrupt can be generated by a device or a program to inform the operating system
to halt its current activities and focus on something else. The types of interrupts are
better explained using the following diagram −

Hardware and software interrupts are two types of interrupts. Hardware interrupts are
triggered by hardware peripherals while software interrupts are triggered by software
function calls.
Hardware interrupts are of further two types. Maskable interrupts can be ignored or
disabled by the CPU while this is not possible for non maskable interrupts.

A computer system is basically a machine that simplifies complicated tasks. It should


maximize performance and reduce costs as well as power consumption.The different
components in the Computer System Architecture are Input Unit, Output Unit, Storage
Unit, Arithmetic Logic Unit, Control Unit etc.
A diagram that shows the flow of data between these units is as follows −
The input data travels from input unit to ALU. Similarly, the computed data travels from
ALU to output unit. The data constantly moves from storage unit to ALU and back
again. This is because stored data is computed on before being stored again. The
control unit controls all the other units as well as their data.
Details about all the computer units are −

• Input Unit
The input unit provides data to the computer system from the outside. So,
basically it links the external environment with the computer. It takes data from
the input devices, converts it into machine language and then loads it into the
computer system. Keyboard, mouse etc. are the most commonly used input
devices.

• Output Unit
The output unit provides the results of computer process to the users i.e it links
the computer with the external environment. Most of the output data is the form
of audio or video. The different output devices are monitors, printers, speakers,
headphones etc.

• Storage Unit
Storage unit contains many computer components that are used to store data.
It is traditionally divided into primary storage and secondary storage.Primary
storage is also known as the main memory and is the memory directly
accessible by the CPU. Secondary or external storage is not directly accessible
by the CPU. The data from secondary storage needs to be brought into the
primary storage before the CPU can use it. Secondary storage contains a large
amount of data permanently.

• Arithmetic Logic Unit


All the calculations related to the computer system are performed by the
arithmetic logic unit. It can perform operations like addition, subtraction,
multiplication, division etc. The control unit transfers data from storage unit to
arithmetic logic unit when calculations need to be performed. The arithmetic
logic unit and the control unit together form the central processing unit.

• Control Unit
This unit controls all the other units of the computer system and so is known as
its central nervous system. It transfers data throughout the computer as
required including from storage unit to central processing unit and vice versa.
The control unit also dictates how the memory, input output devices, arithmetic
logic unit etc. should behave.

Computer Architecture
Computer Architecture is a blueprint for design and implementation of a computer
system. It provides the functional details and behaviour of a computer system and
comes before computer organization. Computer architecture deals with 'What to do?'

Computer Organization
Computer Organization is how operational parts of a computer system are linked
together. It implements the provided computer architecture. Computer organization
deals with 'How to do?'
Following are some of the important differences between Computer Architecture and
Computer Organization.

Sr. Key Computer Architecture Computer Organization


No.

Purpose Computer architecture explains Computer organization explains how a


1
what a computer should do. computer works.

Target Computer architecture provides Computer organization provides structural


2 functional behavior of computer relationships between parts of computer
system. system.

Design Computer architecture deals with Computer organization deals with low leve
3
high level design. design.
Sr. Key Computer Architecture Computer Organization
No.

Actors Actors in Computer architecture Actor in computer organizaton is


4
are hardware parts. performance.

Order Computer architecture is designed Computer organization is started after


5
first. finalizing computer architecture.

2.

OpenMP is a library for parallel programming in the SMP (symmetric


multi-processors, or shared-memory processors) model. When
programming with OpenMP, all threads share memory and data.
OpenMP supports C, C++ and Fortran. The OpenMP functions are
included in a header file called omp.h .
OpenMP program structure: An OpenMP program has sections that are
sequential and sections that are parallel. In general an OpenMP
program starts with a sequential section in which it sets up the
environment, initializes the variables, and so on.

When run, an OpenMP program will use one thread (in the sequential
sections), and several threads (in the parallel sections).

There is one thread that runs from the beginning to the end, and it's
called the master thread. The parallel sections of the program will cause
additional threads to fork. These are called the slave threads.

A section of code that is to be executed in parallel is marked by a special


directive (omp pragma). When the execution reaches a parallel section
(marked by omp pragma), this directive will cause slave threads to form.
Each thread executes the parallel section of the code independently.
When a thread finishes, it joins the master. When all threads finish, the
master continues with code following the parallel section.

Each thread has an ID attached to it that can be obtained using a


runtime library function (called omp_get_thread_num()). The ID of the
master thread is 0.

Why OpenMP? More efficient, and lower-level parallel code is possible,


however OpenMP hides the low-level details and allows the programmer
to describe the parallel code with high-level constructs, which is as
simple as it can get.

OpenMP has directives that allow the programmer to:

specify the parallel region


specify whether the variables in the parallel section are private or shared
specify how/if the threads are synchronized
specify how to parallelize loops
specify how the works is divided between threads (scheduling)

3.
#include <omp.h>

#pragma omp parallel


{
printf("Hello World... from thread = %d\n",
omp_get_thread_num());
}

You might also like