Example Code

4-Bit Binary Counter Simulation with LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This simple example is a 4-bit counter, consisting of a number of flip-flops, count a stream of pulses applied to the counter’s CK input. The output is a binary value whose value is equal to the number of pulses received at the CK input.

 

Description

Each output represents one bit of the output word, which, in 74 series counter ICs is usually 4 bits long, and the size of the output word depends on the number of flip-flops that make up the counter. The output lines of a 4-bit counter represent the values1,2,4 and 8 respectively. They are normally shown in schematic diagrams in reverse order, with the least significant bit at the left, this is to enable the schematic diagram to show the circuit following the convention that signals flow from left to right, therefore in this case the CK input is at the left.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run the VI.
  2. The counter start counting from 0.
  3. Click the stop button to stop this VI. Or it will continue counting to 15 and restart from 0 to 15.

Additional Information or References 

VI Snippet

143.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**
 
 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.