0% found this document useful (0 votes)
22 views4 pages

CSE001 Computer Programming

The document outlines the basic components of a computer, including input/output units, the Central Processing Unit (CPU), main memory, and secondary storage. It describes the differences between memory types such as RAM and ROM, as well as the CPU's components like the Control Unit and Arithmetic Logic Unit (ALU). Additionally, it explains how programs are executed and the role of various registers in the CPU.

Uploaded by

Faris Sameh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
22 views4 pages

CSE001 Computer Programming

The document outlines the basic components of a computer, including input/output units, the Central Processing Unit (CPU), main memory, and secondary storage. It describes the differences between memory types such as RAM and ROM, as well as the CPU's components like the Control Unit and Arithmetic Logic Unit (ALU). Additionally, it explains how programs are executed and the role of various registers in the CPU.

Uploaded by

Faris Sameh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
Section #\ Basic Computer ComPonents 3 Output Unies Cl Input Units - Central Processing Unit (CPU) Arithmetic Logic Unit (aww) Main Memory Unit Control Unit Secondary Storage Units (i) Taput/output units ¢ Components that directly interact with the user boy talking inputs JF delveriag output (Memory units these are the units to Store data required for Compiler to run Y execute Programs. two main types: RAM F ROM this is the Mon Hen a S. Used to store dala [sed to slore dala of the Progrom ‘while | required for the unchangeable cata ike ifo devices. Volatile : lose its Content when Power off Qu: what ace the types of Rone (11 ROM: this is the oldest type of ROM arat Cannot be erased (21 PROM (Programmable Ro): this type Con be Pregrammad Only Gace ofler Programming it Cannot be emsed. (3) EPROM (erasable Progammable Rol): this type Coa be Programmed and eased 7 EEPROM(Elechically erasable PROM): Some as EPROM but erased by elechicily (2) Secondary Storage unils: used to store all Programs, user deta ...ete. featuers : non. Yolatile « Slower than the memory units types: « intemal : hard disks « extemal: Floppy dist, flash memory... ete Q2: Whet is the difference between memory units J Secondary storage ? Main Memory Secondary Storage Example RAM, ROM Hard Disk Technology Semi-conductors Magnetic Field Connection ‘On board Out of board Speed Faster Slower Storage size Smaller Larger Cost More expensive _ Less expensive WCertal Processing Unit(CPu): Whee all arithmekic fe logic operates ave done also it Contel all ather Components by Control unit. Bosic Components of CPU: Main Memory — Control Unit | ALU CPU 11 Conbol unit: Produce Coabol signal to Gabel CPu F other Components Operations. BI Adithmekic logic unit (AlU): used to Perform all arithmelic (additicn, Subbackoa , mullPl Cakon...elc) F legical CAND, or , not---) @ Registes: these ae small storage units inside CPu to stove Some values during execution. [4] Memory Registers : two registers a. MAR (Memon Addeess Register): holds the address of memory we want to access b. MDR(Menory Data Register): holds data Comming from oF Going to Memory or instuctn Comming From the mensry Nemo Measurements: Computer: is the digital device that handels electicily into two lewls ai) FCan execute Programs. cabit: the smallest unit of memory Can Store | or © Galy. wy byle s leller 2 Character: it is the vert larger unit 2 Sbit _+ Word: it is a mulkiple of byte B 8 byte 2". ilo 2, ep . ut oe 7 the largest Qs. Convert 2648MB into GB. Me 22, GB 2648MB =z 2CB HAR « wbit Hrs mens wwe Con otces 24216 7 Weaken to Hemet} MAR used fy occss the menery S mist have 0 reper width gt ah oddeses of dhe menor) eee MBR 8 Mast be of the sane width of ‘emery, lotion Q5: Calewete the memory SiL@ in Kilobytes if the size of MOR and MAR ave K bits ond Io bit respectivly. MAR = \obit locations location MOR 2 \Gbit ___. location size = Igbit Memory Size #locubions x locukon size 2 xe bit 2 . r 4, Kilo bt =8 . byte Ic Memon Cize (KB) = ai: 2KB Qe. what ave the CPu ComPoneds used to Communicate with memory 2 () MAR (a MBR (5) Conk unit it] Program Counter (PC) : holds the address of next inshucken to be executed Q7: How Progam is executed ? Computer Program is set of nshuckions to be executed in onler (6) Inskucton Reqistec(LR): Sfecial register hela the inshuckon while execubag Qs: Wht a the steps to execute this Commond inside the Computer? Mut Loci3u, R7 Rif pw [re | IR | oR fr 2} - | 1200 - - - 2 - 1200 - - \200 2 t \2c0 - met ee Taco a} - tame fmt zest Perse OY ar a} - vat fom se 8H Pm we 88 Nata9 a] - niet frtsc on Paw we a8 | gy 2) yao J mee ot ny 130 2) 4 vac) | me ge ot 4 |n 2] a Pyar | meee Tyg 2} we=8 x01 | 9S 4 fisn a) - vo ee 4 ‘au 8. Ifthe contents of the main memory and the contents of the registers in the Central Processing Unit (CPU) are as shown below: Location address | Contents ‘Subtract 100. ‘SUB Loca, RO ‘Addition 101 ADD LocB , RI fultiplication. 102 MUL LocA , RT Lock 120 6 LocB 21 5 Register| Contents PC 102 MAR 12 MDR 15 RO 5 RI 10 A. Ifthe PC contains a value of 101, what instruction will be executed in the next step? B. Mention the steps for executing the instruction MUL LocA, R1 and the contents of the registers MAR, MDR, PC, and R1 at each step. A. 0s the PC hdds the address of instuction 4o be execided then the net instuckon 4c be executed ic ADD locB,Ri 8. = intial Ydues

You might also like