Skip to content

mariam-al0/CodingChallenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Challenge! >:)

Good luck...

1. bitShift

This method will take in a String of length 8 with ones and zeros (representing bits), a boolean direction (with true being right and false being left), and an amount. This method will return a String that represents a bit shift of that amount. Note that there are no leading zeros.

Examples :

bitShift("10000000", true, 1) -> "1000000"

bitShift("00000001", false, 1) -> "10"

2. xor

This method will compute the logical xor (exclusive or) operation. The catch is that this must be done with ONLY logical ands, logical ors, and logical nots. DO NOT USE THE NATIVE JAVA XOR!

3. multiplexer

You just get a truth table.

s0 | s1| F

0 | 0 | x + y

0 | 1 | xy

1 | 0 | x

1 | 1 | y

4. binaryToDecimal

This method will take a String of any length with ones and zeros (reperesenting bits). You will return the decimal number the String represents.

5. decimalToBinary

This method will take an int representing a number. You will return the binary representation of that number with using a String.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%