• 沒有找到結果。

Computer Organization and Assembly Languages Assignment 1

N/A
N/A
Protected

Academic year: 2022

Share "Computer Organization and Assembly Languages Assignment 1"

Copied!
2
0
0

加載中.... (立即查看全文)

全文

(1)

Computer Organization and Assembly Languages Assignment 1 (Due date: 10/20)

1. Conversion between different bases.

(a) Convert 19.7812510 to the hexadecimal and octal numbers.

(b) Convert -92310 to the 16-bit hexadecimal number.

2. Ranges of signed integer.

Given that x and y are 8-bit signed integers. Their values are unknown. Please indicate if the following propositions, expressed in C language, are true or false, and give a counterexample for those marked as “false.”

(a) If x > 0 then x + 1 > 0 (b) If x < 0 then x * 2 < 0 (c) If x > y then -x < -y (d) If x >= 0 then -x <= 0 (e) If x < 0 then -x > 0

(f) If x >= 0 then (( !x – 1 ) & x ) == x (g) If x < 0 && y > 0 then x * y < 0 (h) If x < 0 then ((x ^ x >> 31) + 1) > 0

3. {OR, NOT} and {AND, NOT} are minimal complete sets.

(a) Show that how an AND gate can be implemented using OR and NOT gates.

(b) Show that how a OR gate can be implemented using AND and NOT gates.

4. Proof of de Morgan’s law.

Prove the and version of de Morgan’s law, xy= x+y. Hint: consider the complement law, x⋅ x=0 and x+ x=1.

5. Boolean algebra.

The following two expressions represent the even-parity function.

Sum of products: ABC+ABC+A BC+A BC;

Product of sums: (A+B+C)( A+B+C )(A+B+C )(A+B+C). Show they are equivalent using Boolean algebra.

(2)

6. Logic circuit design.

(1) Show the truth table of a function that outputs a 1 whenever the 4-bit input is divisible by 4, where the input is treated as a 4-bit unsigned binary integer.

(2) Derive a simplified logical expression with the Karnaugh map method.

(3) Show an implementation of the function

7. Combinational circuit.

An odd-parity function is defined as: output is 1 whenever there is an even number of 1s in the input. Implement a 3-input odd-parity function using 4-to-1 multiplexer(s). You may use additional inverters in your implementation.

8. SR latches.

Suppose we replace the NOR gates by NAND gates in the SR latch. Please give the truth table for the new circuit. Can you argue that this new circuit is essentially equivalent to the original SR latch?

9. JK flip-flops.

A gray code is defined as a sequence of numbers, where two successive numbers differ in only one digit. Design a counter to implement a 3-bit gray code whose sequence is 000, 001, 011, 010, 110, 111, 101, and 100. The code is cycle. The answer should show the implementation.

參考文獻

相關文件

Here is

[Hint: You may find the following fact useful.. If d is a metric for the topology of X, show that d|A × A is a metric for

circuit sat: Given a circuit, is there a truth assignment such that the circuit outputs true?. • circuit sat ∈ NP: Guess a truth assignment and then evaluate the

circuit sat: Given a circuit, is there a truth assignment such that the circuit outputs true?.. • circuit sat ∈ NP: Guess a truth assignment and then evaluate the

circuit sat: Given a circuit, is there a truth assignment such that the circuit outputs true?.. • circuit sat ∈ NP: Guess a truth assignment and then evaluate the

Remark: All the sequences are sequence of real numbers.. Formula that might be useful: Let θ

circuit sat: Given a circuit, is there a truth assignment such that the circuit outputs truea. • circuit sat ∈ NP: Guess a truth assignment and then evaluate

[r]