Professional Documents
Culture Documents
Fa22-Bse-011, Hafiz Muzammal Ahmad, Assignment#02
Fa22-Bse-011, Hafiz Muzammal Ahmad, Assignment#02
Name:
Hafiz Muzammal Ahmad
Reg No:
FA22-BSE-011
Submitted To:
Dr Misbah
Subject:
Discrete Structure
CUI
(Sahiwal Campus)
USE OF GATES IN HARDWARE:-
To build digital circuitry, logic gates are a necessary
component. They perform logical processes that are
crucial for digital circuits at the very least. In most of the
electrical devices we use today, logic gates are present.
Uses in Software:-
Software uses AND gates for programming and
developing methods.
Programming AND gates may be used to control the flow
of processes.
Software AND gates are used to implement boolean logic
operations like AND, NAND, and XOR. These techniques
are often applied in the development of algorithms.
Computer software uses AND gates to carry out bit-wise
operations. These procedures are often used in low-level
programming as well as system programming.
Summary:
Control flow, Boolean logic, bit manipulation, and system
programming are all performed via logic gates, which are
also utilised to build digital circuits.
THE FOLLOWING IS THE EXAMPLE OF THE CODE IN
C++ USING THE LOGICAL OPERATORS
CODE:-
#include <iostream>
using namespace std;
int main() {
int age = 25;
bool is_student = false;
return 0;
}
Output:
You are eligible to vote.
You are eligible to work.
--------------------------------
Process exited after 0.0367 seconds with return value 0
Press any key to continue . . .