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

Digital Assignment-1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

DIGITAL ASSIGNMENT-1

NAME: BEJUGAM SHIVA SUPRITH


REG NO: 18BCE0427
FACULTY: NARAYAMOORTHY
SLOT: C1
a) Study of Computer System Organization

 A computer is an electronic data processing machine that accepts data and


instructions through input unit (or from memory) and processes data as per the
instruction, to get desired output.
 A computer system is a complex system consists of both hardware and software.
 The hardware components of a computer system are the electronic and mechanical
parts
 The software components of a computer system are the data andthe computer
programs.
 The computer systems we build today feature programmable processing units which
interact with a number of devices, each controlled by an I/O controller, and using
memory.

The organization of a simple computer with one CPU and two I/O devices
Central processing Unit:
The central processing unit (CPU) is the unit which performs most of the processing
inside a computer. To function properly, the CPU relies on the system clock, memory,
secondary storage, and data and address buses.
CPU have Arithmetic and Logic Unit (ALU) and Control Unit.
Arithmetic and Logic Unit (ALU)

 Most computer operations are performed at ALU


Example:-

Control Unit:-

 Operations of all the units are coordinated by control unit


 Sends control signal to all the units
 Timing signals that govern the data transfer, are generated by control circuits
 Timing signals are signals that determine when a given action takes place

Memory:-

 Physical device to store programs or data


 Two types: Main memory (Physical memory) and Secondary memory

Main Memory:
Closely connected to processor,Stored data are quickly and easly changed,holds the
programs and data that the processor is actively working with, needs constant electric
power to keep its information and interacts with the processor millions of times per
second.
Secondary memory:
connected to main memory through the bus and a controller, stored data are easily
changed; but changes are slow compared to main memory,used for long-term storage of
programs and data before data and programs can be used; they must be copied from
secondary memory into main memory and does not need electric power to keep its
information
b)Study of parallel programming languages and introduction to Open MP

Parallel Computing :

Parallel computing is the use of two or more processors in combination to solve a single
problem. Problems that require large amount of computation memory or both.Parallel
computing has made a tremendous impact on a variety of areas ranging from
computational simulations for scientific and engineering applications to commercial
applications in data mining and transaction processing.
The computing resource includes:-

• A single computer with multiple processors


• A single computer with multiple processors and some specialized compute resources
like GPU,FPGA, etc

• An arbitrary number of computers connected by a network


• A combination of above

parallel programming languages:-

Parallel programming languages are languages designed to program algorithms and


applications on parallel computers. Parallel processing is a great opportunity for developing
high performance systems and solving large problems in many application areas. During the
last few years parallel computers ranging from tens to thousands of computing elements
became commercially available. They continue to gain recognition as powerful tools in
scientific research, information management, and engineering applications.
This trend is driven by parallel programming languages and tools that contribute to make
parallel computers useful in supporting a broad range of applications. Many models and
languages have been designed and implemented to allow the design and development of
applications on parallel computers. Parallel programming languages (called also concurrent
languages) allow the design of parallel algorithms as a set of concurrent actions mapped
onto different computing elements.
OpenMp:-

OPENMP IS A PARALLEL PROGRAMMING MODEL for shared memory and distributed


shared memory multiprocessors. Pioneered bySGI and developed in collaboration with
other parallel computer vendors,OpenMP is fast becoming the de facto standard for
parallelizing applications. There is an independent OpenMP organization today with most
ofthe major computer manufacturers on its board, including Compaq,Hewlett-Packard,
Intel, IBM, Kuck & Associates (KAI), SGI, Sun, and theU.S. Department of Energy ASCI
Program.
OpenMP is not a new computer language; rather, it works in conjunc-tion with either
standard Fortran or C/C++. It is comprised of a set ofcompiler directives that describe the
parallelism in the source code, alongwith a supporting library of subroutines available to
applications (seeAppendix
A). Collectively, these directives and library routines are for-mally described by the
application programming interface (API) nowknown as OpenMP.
OpenMP is primarily designed for shared memory multiprocessors.The important
aspect for our current purposes is that all of the processors are able to directly
access all of the memory in the machine, through a logically direct connection.

c)Write a c-program using open MP to print hello world


CODE:

#include<stdio.h>

#include<conio.h>

#include<omp.h>

void main(void)

omp_set_num_threads(3);

#pragma omp parallel

printf("sample\n");

}
OUTPUT:

CODE:

#include<stdio.h>

#include<conio.h>

#include<omp.h>

void main(void)

omp_set_num_threads(10);

#pragma omp parallel

printf("sample\n");

OUTPUT:

You might also like