1 / 24

14-4 Masks

Learn about the concept of bit masks and how they are used as binary flags in computer programs. Explore creating masks, using masks, and practical examples in C programming. Gain insights into determining network addresses and polynomial division.

laurasam
Download Presentation

14-4 Masks

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. 14-4 Masks In many programs, bits are used as binary flags: 0 is off, and 1 is on. To set and test the flags, we use a bit mask. A mask is a variable or constant, usually stored in a byte or short integer. The bits are numbered from the least significant bit (rightmost), starting at 0. Topics discussed in this section: Creating Masks Using Masks Computer Science: A Structured Programming Approach Using C

  2. FIGURE 14-5 Bit Mask in a 16-bit Integer Computer Science: A Structured Programming Approach Using C

  3. PROGRAM 14-9 Determine Network Address Computer Science: A Structured Programming Approach Using C

  4. PROGRAM 14-9 Determine Network Address Computer Science: A Structured Programming Approach Using C

  5. PROGRAM 14-9 Determine Network Address Computer Science: A Structured Programming Approach Using C

  6. PROGRAM 14-9 Determine Network Address Computer Science: A Structured Programming Approach Using C

  7. PROGRAM 14-10 Determine Last Address in a Network Computer Science: A Structured Programming Approach Using C

  8. PROGRAM 14-10 Determine Last Address in a Network Computer Science: A Structured Programming Approach Using C

  9. PROGRAM 14-10 Determine Last Address in a Network Computer Science: A Structured Programming Approach Using C

  10. PROGRAM 14-10 Determine Last Address in a Network Computer Science: A Structured Programming Approach Using C

  11. FIGURE 14-6 Polynomial Coefficients Computer Science: A Structured Programming Approach Using C

  12. FIGURE 14-7 Polynomial Division Computer Science: A Structured Programming Approach Using C

  13. PROGRAM 14-11 Polynomial Division Computer Science: A Structured Programming Approach Using C

  14. PROGRAM 14-11 Polynomial Division Computer Science: A Structured Programming Approach Using C

  15. PROGRAM 14-11 Polynomial Division Computer Science: A Structured Programming Approach Using C

  16. PROGRAM 14-11 Polynomial Division Computer Science: A Structured Programming Approach Using C

  17. 14-5 Software Engineering In Chapter 12, we looked at what makes a good function. In this section, we look at how you design good programs. Topics discussed in this section: Payroll Case Study Structure Chart Design Computer Science: A Structured Programming Approach Using C

  18. FIGURE 14-8 Requirements for Payroll Case Study Computer Science: A Structured Programming Approach Using C

  19. FIGURE 14-8 Requirements for Payroll Case Study (continued) Computer Science: A Structured Programming Approach Using C

  20. FIGURE 14-8 Requirements for Payroll Case Study (continued) Computer Science: A Structured Programming Approach Using C

  21. Note Good programs start with a good structure chart design. Computer Science: A Structured Programming Approach Using C

  22. FIGURE 14-9 Afferent, Efferent, and Transform Modules Computer Science: A Structured Programming Approach Using C

  23. Table 14-8 Classification of Payroll Modules Computer Science: A Structured Programming Approach Using C

  24. FIGURE 14-10 Streams Computer Science: A Structured Programming Approach Using C

More Related