Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

At this time we have a task for you to do . You are to write several functions that do binary math on character strings

At this time we have a task for you to do. You are to write several
functions that do binary math on character strings of 'T's and 'F's. The
functions you will fill in are: WRITE USING THE LANGUAGE C
#include
#include
#include "binarymath. h"
/**
Negate a BINARY_SIZE binary number expressed as a character string
Cparam number The number we are passed
ereturns negated version of the number
***?
char *negate(const char *number)
[
}
return number;
/**
Add two BINARY_SIZE binary numbers expressed as
a character string.
Eparam a First number to add
Cparan b Second number to add
ereturn a+b
**?
char *add(const char *a, const char *b)
[
return a;
}
/**kt.
Subtract two BINARY_SIZE binary numbers expressed as
a character string.
Cparam a First number
Cparam b Second number
ereturn a - b
***?
char *sub(const char *a, const char *b)
f
}
return a;
1****
Multiply two BINARY_SIZE binary numbers expressed as
a character string.
Cparam a First number
Ceparam b Second number
erreturn a**b
**?
char ?** mul (const char ?**a, const char {:?**b)
[
}
return a;
The file binarymath.h includes the constant BINARY_SIZE:
/// The size of the binary numbers to use
#define BINARY_SIZE 100
You can use this value in expressions just like any other number:
Create a circuit for 2-to-4 demultiplexer in Cirsim. Name the inputs S0,
S1, and I. Name the outputs 00,01,02, and 03. They should match the
same values in the characteristics table table.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions

Question

What is the role of the Joint Commission in health care?

Answered: 1 week ago