Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-5wvtr Total loading time: 0 Render date: 2024-07-21T06:56:36.414Z Has data issue: false hasContentIssue false

Laboratory exercise

from 1 - Digital tools

Published online by Cambridge University Press:  04 August 2010

Stephen E. Derenzo
Affiliation:
University of California, Berkeley
Get access

Summary

Purpose

To use a compiler/editor to write and compile a simple C program. To investigate the 2's complement unsigned, and hexadecimal representation of 8-, 16-, and 32-bit numbers, to use the printf function for printed output, and the scanf function for interactive program control and data entry.

Equipment

  • IBM-compatible Pentium microcomputer with Windows NT operating system and Microsoft Visual C++ compiler

  • Printer (shared with other laboratory stations)

Additional reading

  1. Appendix C: C programming hints

  2. Section 1.3 Number systems

  3. B. W. Kernighan and D. M. Ritchie, The C Programming Language, Prentice Hall, Englewood Cliffs, NJ, 1988.

Procedure

Microsoft Visual C++ programming environment

You will need a separate project file and folder for each laboratory exercise that requires programming. Rather than creating your own project folder from scratch, copy a “starter project” folder into your file storage area. The laboratory assistant or teaching associate will tell you where to find it on your local network. This folder contains a starter project file with all the library modules that your project will require, and C code files you may need, such as InitAll and fft.c.

Rename the starter project folder and the .dsw project file in it, but be sure to keep the .dsw extension. Start the Microsoft Visual C++ developer studio by double-clicking the shortcut on the desktop. Open the project by clicking on the “File: Open Workspace” command and select your project .dsw file. “File: Close Workspace” will close the project you are currently working on.

Type
Chapter
Information
Practical Interfacing in the Laboratory
Using a PC for Instrumentation, Data Analysis and Control
, pp. 53 - 74
Publisher: Cambridge University Press
Print publication year: 2003

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Laboratory exercise
  • Stephen E. Derenzo, University of California, Berkeley
  • Book: Practical Interfacing in the Laboratory
  • Online publication: 04 August 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511615160.003
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Laboratory exercise
  • Stephen E. Derenzo, University of California, Berkeley
  • Book: Practical Interfacing in the Laboratory
  • Online publication: 04 August 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511615160.003
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Laboratory exercise
  • Stephen E. Derenzo, University of California, Berkeley
  • Book: Practical Interfacing in the Laboratory
  • Online publication: 04 August 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511615160.003
Available formats
×