Explore high-paying careers in clean, high-tech Connecticut manufacturing.

Products

Work-based Learning Projects for the Classroom

Project: BIT Operations - shifting and using a struct and union to create a bit-addressable field

(Summary of Results)

Name of NGM Educator:

Fred D'Angelo, Information Technology/Engineering Professor, Manchester Community College

Name of Host Company:

Gerber Technologies

Grade Level:

For freshman/sophomore level college students

Student Work Types:

 

Task Abstract:

During the course of viewing an instructor's presentation of the attached PowerPoint file, Bitwise Operations in C.ppt, students will work on paper-and-pencil exercise involving bit manipulation using bitwise OR and AND as well as creating bit addressable variables using struts and unions. After the instructor demonstrates the attached C/C++ programs, students will modify values in the programs and observe resulting changes.

Task Objectives:

To acquire an understanding of the relationship between binary and hexadecimal values and using bitwise operations to manipulate them.

Esssential Understandings/Questions:

 

Task Description:

After the instructor presents the PowerPoint slides in  Review for Review for Bitwise Operations in C.ppt, the students perform a number of paper and pencil exercises translating binary values into hexadecimal.

  • Paper and pencil exercise in using the bitwise OR to modify the values in a byte. Samples for this exercise are included in the attached PowerPoint file, Bitwise Operations in C.ppt.

After the instructor demonstrates the functioning of program BitwiseOrAnd.cpp and shows students the code and explains how it works, students will do the following:

  • Paper and pencil exercise in using the bitwise AND to modify the values in a byte. Samples for this exercise are included in the attached PowerPoint file, Bitwise Operations in C.ppt.

After the instructor demonstrates the operation of the C++ program, BitwiseMaskDemo.cpp, students will modify it to use different values for the variables then observe the resulting changes .

After the instructor demonstrates the operation of the C++ program, BitwiseUnionAndStructDemo.cpp, students will modify it to use different values for the variables then observe the resulting changes .

 

Resources Required:

A C/C++ compiler and linker, for instance Microsoft Visual Studio.

Prior Learning Required:

A solid understanding of the basics of writing programs using C/C++ is essential.

Educator Comments:

 

 


The Regional Center for Next Generation Manufacturing is funded through a grant from the National Science Foundation Advanced Technology Education program. Copyright 2005. All rights reserved.