Sunteți pe pagina 1din 9

OUTCOMES

INSTITUTIONAL

IGO1. Generate ideas, plans, and


multiple perspectives in various fields
to solve current needs and issues of
society with preference for the socially
disadvantaged.

IGO2. Utilize appropriate technologies,


methods and techniques to provide
practical and innovative solutions that
achieve their intended purpose.

PROGRAM

PO(a). ability to apply knowledge of


mathematics and science to solve
engineering problems

PO(b). ability to design and conduct


experiments, as well as to analyze and
interpret data

PO(d). ability to function on

LOGIC CIRCUITS AND


multidisciplinary teams

PO(f). understanding of professional

SWITCHING THEORY
and ethical responsibility

PO(g). ability to communicate

[LABORATORY]
effectively

PO(k). ability to use techniques, skills,

ACTIVITY 1: REVIEW OF
and modern engineering tools necessary
for engineering practice

BINARY-BASED NUMBER COURSE

SYSTEMS
CO1. Demonstrate implementation
techniques for individual logic gates.

LEARNING

CILO1. Introduction to the operation of


basic logic gates.

© R. Raguindin 2019
(file:///C:/Users/MSI/Downloads/LCS
T-ACTIVITY1%20(1).pdf)
Objectives
To review the capabilities of MATLAB™ and to utilize MATLAB™ to perform
binary, octal and hexadecimal number operations.

REGLOS, KATHLEEN
JHOREN T.
201513495

BS Electrical Engineering

Class Schedule: Mon (2:00-5:00)

Section: 55062 Logic Circuits and


Switching theory Lab
COLLEGE OF ENGINEERING
Second floor, Ozanam Building
900, San Marcelino Street, Ermita, Manila
Phone (632) 524.20.11 local 405 and 406

DATA SHEET
PROCEDURE ANSWER
1. Convert decimal 2019 to binary.
11111100011
dec2bin(2019)

2. Add two binary numbers.


a = ‘1001’ 10101
b = ‘1100’
c = dec2bin ( bin2dec( a ) + bin2dec( b ) )

3. Subtract two binary numbers.


1010
dec2bin ( bin2dec( ‘1101’ ) — bin2dec( ‘11’ ) )

4. Convert binary fraction to decimal.


110001
dec2bin( ‘11.001’ ) 110001
101110
110000
110000
110001

5. Convert octal 2019 to decimal.


oct2dec( ‘2019’ ) For oct2dec( ‘2019’ ) input, (Error using oct2dec, oct2dec
oct2dec( ‘2017’ ) requires the argument to be a non-empty octal matrix).
For oct2dec( ‘2017’ ) input, the answer is
1039
6. Multiply two octal numbers.
dec2oct ( oct2dec( ‘17’ ) * oct2dec( ‘62’ ) ) 1356

7. Divide two octal numbers.


dec2oct ( oct2dec( ‘700’ ) / oct2dec( ‘20’ ) ) 34

8. Convert hexadecimal AB to decimal.


hex2dec('face') 64206

9. Raise to an exponent a hex number with


another hex number. 86430AAC61
dec2hex ( hex2dec( ‘f’ ) ^ hex2dec( ‘a’ ) )

10. Study the properties of the DEC2BASE


command. Do not copy the output anymore.
--------------------------

help dec2base.

For the Spirit God gave us does not make us timid, but gives us

power, love and self-discipline. - 2 Timothy 1:7


COLLEGE OF ENGINEERING
Second floor, Ozanam Building
900, San Marcelino Street, Ermita, Manila
Phone (632) 524.20.11 local 405 and 406

DATA SCREENSHOTS

SC1.

SC1. Converting decimal number system 2019 to binary system using the command
dec2bin.

SC2.

SC2.The above image shows the addition of two binary numbers by simply setting letter a and
b to a specific binary number (1001 and 1100) so that when using the command
dec2bin(bin2dec(a)+bin2dec(b)) we can simply use the letter, set with a specific value.

For the Spirit God gave us does not make us timid, but gives us

power, love and self-discipline. - 2 Timothy 1:7


COLLEGE OF ENGINEERING
Second floor, Ozanam Building
900, San Marcelino Street, Ermita, Manila
Phone (632) 524.20.11 local 405 and 406

SC3.

Sc3. The above image shows the command when subtracting two binary numbers (1101 and
11).

SC4.

Sc.4 The above image shows the conversion of binary fraction (11.001) to decimal.

For the Spirit God gave us does not make us timid, but gives us

power, love and self-discipline. - 2 Timothy 1:7


COLLEGE OF ENGINEERING
Second floor, Ozanam Building
900, San Marcelino Street, Ermita, Manila
Phone (632) 524.20.11 local 405 and 406

Sc5.1

SC5.1 The above image shows the conversion of octal to decimal but octal number
system only accepts the numbers from zero to seven so the answer is error.

SC5.2

Sc5.2 The above image shows the conversion of octal (2017) to decimal using the
oct2dec command.

For the Spirit God gave us does not make us timid, but gives us

power, love and self-discipline. - 2 Timothy 1:7


COLLEGE OF ENGINEERING
Second floor, Ozanam Building
900, San Marcelino Street, Ermita, Manila
Phone (632) 524.20.11 local 405 and 406

SC6.

Sc6. Converting decimal to octal is a wrong argument so the command help


dec2base can be used as it discuss how to convert decimal integer to base B string. Since the
procedure is multiplication of two octal number, dec2base(product,base) is the command to
be use and the base is 8.

For the Spirit God gave us does not make us timid, but gives us

power, love and self-discipline. - 2 Timothy 1:7


COLLEGE OF ENGINEERING
Second floor, Ozanam Building
900, San Marcelino Street, Ermita, Manila
Phone (632) 524.20.11 local 405 and 406

Sc7.

Sc7. The above image shows the division of two octal numbers. Again, base 8 should also be
input when using the dec2base command.

SC8.

Sc8. The above image shows the conversion hexadecimal (face) to decimal.

SC9.

Sc9. The above image shows raising a hexadecimal with another hexadecimal.

For the Spirit God gave us does not make us timid, but gives us

power, love and self-discipline. - 2 Timothy 1:7


COLLEGE OF ENGINEERING
Second floor, Ozanam Building
900, San Marcelino Street, Ermita, Manila
Phone (632) 524.20.11 local 405 and 406

DATA ANALYSIS
As I conducted the activity number 1 entitled “Review of Binary-based Number Systems” with

the use of MATLAB. I was able to analyze different commands that can be used to convert decimal to

binary, octal to decimal, binary to decimal,. Etc. For example, the conversion of decimal 2019 to binary.

I also learned that binary number system is composed of only two digits, which are 1 and 0. For octa, it

has only 0-7 number values which implies for my answer in number 5.a ((oct2dec (‘2019’)) which is

error. For number 6, with the command (dec2oct(oct2dec(‘17’)*oct2dec(‘62’)), the result will also

appear as error, I used the command help dec2base to understand it properties, with this I was able

to understand that the product should be in base 8 to be able to get the right answer, same goes for

number 7. For number 8, conversion of hexa to decimal can easily be solve as long as the values of

hexadecimal used are from 0-9 and letters A to G, letters A to G corresponds to numbers 11-16 . Same

goes when raising a hexa with another hexa (procedure #9).

For the Spirit God gave us does not make us timid, but gives us

power, love and self-discipline. - 2 Timothy 1:7


COLLEGE OF ENGINEERING
Second floor, Ozanam Building
900, San Marcelino Street, Ermita, Manila
Phone (632) 524.20.11 local 405 and 406

CONCLUSION

I therefore conclude that MATLAB is an easy way to convert, raise, multiply, add, subtract nor

divide octa, decimal, hexa and binary number systems but not all values can be converted directly from

one number system to another. I also concluded that when using the MATLAB’s commands, properties

of each number system should be applied to the values given, specially the corresponding base because

if not, the answer will always appear as error even we input the right commands.

RECOMMENDATIONS

I recommend to search for more additional commands under binary-based

number system for it will help the students increase the knowledge about it when

using MATLAB. Also always double check the answers personally using calculator

or manual calculation since it is discussed under the Logic Circuit and Switching

Theory Lecture, always double check.

OTHER LEARNINGS

In addition to what I have learned, binary based number system is the language of

the computer. We communicate with each other in a particular language made

of letters or words. We normally type letters or words through keyboard of the

computer, but computer does not understand By studying other number systems

such as decimal (10), binary (base 2), octal (base 8), hexadecimal (base 16), we will

gain a better understanding of how number systems work in general.

For the Spirit God gave us does not make us timid, but gives us

power, love and self-discipline. - 2 Timothy 1:7

S-ar putea să vă placă și