1 / 28

Ceng 230 Programming with C Tansel Dökeroğlu Computer Engineering Department Spring 2013

Ceng 230 Programming with C Tansel Dökeroğlu Computer Engineering Department Spring 2013 ceng230.ceng.metu.edu.tr http://www.ceng.metu.edu.tr/~e1451970/ tansel@ceng.metu.edu.tr. Bit and Byte.

keita
Télécharger la présentation

Ceng 230 Programming with C Tansel Dökeroğlu Computer Engineering Department Spring 2013

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ceng 230 Programmingwith C Tansel Dökeroğlu ComputerEngineeringDepartment Spring 2013 ceng230.ceng.metu.edu.tr http://www.ceng.metu.edu.tr/~e1451970/ tansel@ceng.metu.edu.tr

  2. Bit andByte A bit is a single numeric value, either '1' or '0', that encodes a single unit of digital information. A byte is a sequence of bits; usually eight bits equal one byte.

  3. Conceptual Structure of a ComputerSystem

  4. • Computer – Device capable of performing computations andmakinglogicaldecisions – Computers process data under the control of sets ofinstructionscalledcomputerprograms • Hardware – Variousdevicescomprising a computer – Keyboard, screen, mouse, disks, memory, CD-ROM, printer, andprocessingunits • Software – Programs that run on a computer – Microsoft Windows, Microsoft Office, Internet Explorer

  5. Memory • Storeinformation (data + instructions) • A sequence of memory cells. – a byte is 8 bits – a bit is the smallest unit (0 or 1) • Store, retrieve, update – changing the pattern of 0 and 1s in memory cells – copying these patterns into some internal registers • Stored information in memory is volatile.

  6. CPU (CentralProcessingUnit) • Processandmanipulateinformationstoredin memory. • It can be divided into two units: CU (ControlUnit) and ALU (Arithmetic Logic Unit) • CU coordinates activities of the computer andcontrols other devices of computer. • ALU processes arithmetical and logicalinstructions.

  7. History of C • C – Developed by Denis M. Ritchie at AT&T Bell Labs in 1972 as a systems programming language – Used to develop UNIX – Used to write modern operating systems – Hardware independent (portable) • Standardization – Many slight variations of C existed, and were incompatible – Committee formed to create a "unambiguous, machineindependent“ definition – Standard created in 1989, updated in 1999

  8. Flow chart of a program (Algorithm) In mathematics and computer science, an algorithmis a step-by-step procedure for calculations.

  9. Other High-level Languages – C++ • Superset of C, and provides object-oriented capabilities – Java • Create web pages with dynamic and interactive content – Fortran • Used for scientific and engineering applications – Cobol • Used to manipulate large amounts of data – Pascal • Intended for academic use

  10. C language developmentenvironment

  11. printf( "Welcome to \%d", (3/2) ); Output is : 1

  12. ! exclamation mark

  13. The C Standard Library • C programs consist of pieces/modules called functions – A programmer can create his own functions time consuming – Programmers will often use the C library functions Use these as building blocks – Avoid re-inventing the wheel If a pre-made function exists, generally best to use it ratherthan write your own Library functions carefully written, efficient, and portable

  14. Use search machines while studying

  15. Devc++ to write C code http://www.bloodshed.net/devcpp.html

More Related