Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given two 4-bit unsigned binary numbers A3 A2 A1 A0 and B3 B2 B1 B0 , construct

ID: 2081219 • Letter: G

Question

Given two 4-bit unsigned binary numbers A3 A2 A1 A0 and B3 B2 B1 B0 , construct a comparator circuit which outputs three bits AltB, AeqB and AgtB. AltB=1 if and only if A3 A2 A1 A0 < B3 B2 B1 B0 . AeqB=1 if and only if A3 A2 A1 A0 = B3 B2 B1 B0 . AgtB=1 if and only if A3 A2 A1 A0 > B3 B2 B1 B0 .

Please use one 4-bit ripple-carry adder and a minimal number of basic gates (i.e., NOT, AND, OR, NAND, NOR, XOR) in your design. <------- (please, only use those only.   4-bit ripple-carry adder must be used)

Hint: Note that A3 A2 A1 A0 > B3 B2 B1 B0 if and only if B3 B2 B1 B0 - A3 A2 A1 A0 + 24 < 24 . Consider how you can perform B3 B2 B1 B0 - A3 A2 A1 A0 + 24 based on a 4-bit ripple-carry adder and how you can detect if the result is less than 24 .

Explanation / Answer

FUNDAMENTALS OF DIGITAL LOGIC WITH VERILOG DESIGN, THIRD EDITION Published by McGraw-Hill, a business unit of The McGraw-Hill Companies, Inc., 1221 Avenue of the Americas, New York, NY 10020. Copyright 2014 by The McGraw-Hill Companies, Inc. All rights reserved. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written consent of The McGraw-Hill Companies, Inc., including, but not limited to, in any network or other electronic storage or transmission, or broadcast for distance learning. Some ancillaries, including electronic and print components, may not be available to customers outside the United States. This book is printed on acid-free paper. 1 2 3 4 5 6 7 8 9 0 DOC/DOC 1 0 9 8 7 6 5 4 3 ISBN 9780073380544 MHID 0073380547 Managing Director: Thomas Timp Director: Michael Lange Global Publisher: Raghothaman Srinivasan Developmental Editor: Vincent Bradshaw Marketing Manager: Curt Reynolds Director, Content Production: Terri Schiesl Senior Project Manager: Melissa M. Leick Buyer: Susan K. Culbertson Media Project Manager: Prashanthi Nadipalli Cover Design: Studio Montage, St. Louis, Missouri (USE) Cover Image: Steven Brown and Zvonko Vranesic Compositor: Techsetters, Inc. Typeface: 10/12 Times Roman Printer: R. R. Donnelley, Crawfordsville, IN Library of Congress Cataloging-in-Publication Data Brown, Stephen. Fundamentals of digital logic with Verilog design / Stephen Brown and Zvonko Vranesic. Third edition. pages cm ISBN 9780073380544 (alk. paper) 1. Logic circuitsDesign and
# A vector space V and a subset S of V are given, determine whether S is closed under addition and multiplication and # whether S is a subspace of V. # 23. f1 = a0 + a1*x1 + a2*x2 + a3*x3 + a4*x4. # f2 = b0 + b1*x1 + b2*x2 + b3*x3 + b4*x4. # ( f1+f2 ) = (a0 + b0)+ (a1 + b1)*x1 +( a2 + b2)*x2 + (a3 + b3)*x3 + (a4 + b4)*x4. # (a0 + b0)+ (a1 + b1) +( a2 + b2) + (a3 + b3) + (a4 + b4) = (a0 + a1 + a2 + a3 + a4) + ( b0 + b1 + b2 + b3 + b4) = 0. # also, c* ( a0 + a1 + a2 + a3 + a4) = 0. So S is closed under addition and scalor multiplication , so S is a subspace of V. # # 24. the same with #23, ( f1+f2 ) = (a0 + b0)+ (a1 + b1)*x1 +( a2 + b2)*x2 + (a3 + b3)*x3 + (a4 + b4)*x4, from # a0*a1*a2*a3*a4 = 0, we can't derive (a0 + b0)* (a1 + b1)*( a2 + b2)*(a3 + b3)* (a4 + b4) = 0, so it' s not under addition. # how ever, c*a0*a1*a2*a3*a4 = 0, so it's under multiplication. S is not a subspace of V. # # 32 Find NS(A) for the given matrix A. # . > with (linalg) : Warning: new definition for norm Warning: new definition for trace > A := matrix(3,3,[3,-1,1,-6,2,-2,-3,1,-1]); [ 3 -1 1 ] [ ] A := [ -6 2 -2 ] [ ] [ -3 1 -1 ] -------------------------------------------------------------------------------- # so vector ([x,y,z]) is a NS(A) if and only if [x,y,z]=t1*[1,3,0]+t2*[0,1,1]. Since A is 3 by 3 matiix, so NS(A) is a subspace # of R(3). # > B := matrix(3,4,[3,-1,1,0,-6,2,-2,0,-3,1,-1,0]); [ 3 -1 1 0 ] [ ] B := [ -6 2 -2 0 ] [ ] [ -3 1 -1 0 ] -------------------------------------------------------------------------------- > read `/afs/eos.ncsu.edu/users/x/xtian/ma305/xREF.mpl`; -------------------------------------------------------------------------------- > xref(B,4); [ 3 -1 1 0 ] [ ] [ 0 0 0 0 ] [ ] [ 0 0 0 0 ] -------------------------------------------------------------------------------- > NS(A) := matrix(3,1,[(y-z)/3,y,z]); [ 1/3 y - 1/3 z ] [ ] NS(A) := [ y ] [ ] [ z ] # Since A is 3 by 3 matiix, so NS(A) is a subspace of R(3). It's a two-dimentional subspace because there're two free # variables. Span R(2). # # # Exercise 3.5 Prob 10,18,30. # Prob 10. # Let x = (a,b,c,d) be any vector , then there are c1,c2,c3,c4 such that x=c1*x1+c2*x2+c3*x3+c4*x4. > A := matrix(4,3,[4,-8,-2,0,0,0,3,-6,-3,-2,4,1]); [ 4 -8 -2 ] [ ] [ 0 0 0 ] A := [ ] [ 3 -6 -3 ] [ ] [ -2 4 1 ] -------------------------------------------------------------------------------- > xref(A,3); [ 4 -8 -2 ] [ ] [ 0 0 -3/2 ] [ ] [ 0 0 0 ] [ ] [ 0 0 0 ] # x2 = (-2)*x1, x1,x2,x3 are linearly dependent. x1,x2,x3 can span a plane. # # Prob. 18. # > A := matrix(4,4,[1,1,1,1,0,1,1,1,0,0,1,1,0,0,0,1]); [ 1 1 1 1 ] [ ] [ 0 1 1 1 ] A := [ ] [ 0 0 1 1 ] [ ] [ 0 0 0 1 ] -------------------------------------------------------------------------------- > xref(A,4); [ 1 1 1 1 ] [ ] [ 0 1 1 1 ] [ ] [ 0 0 1 1 ] [ ] [ 0 0 0 1 ] # From the Row Echlon Form we can see the given vectors are linearly independent. # # Prob. 30. # # If { u_1,u_2,...u_n} are linearly dependent, then there is a non zero solution c=(c_1,...,c_n) such # that c_1*u_1+c_2*u_2+...+c_n*u_n=0. Let c_m=(c_1,c_2,...,c_n,0,..,0), then c_m is a non zero solution # to c_1*u_1+c_2*u_2+...+c_n*u_n+...+c_m*u_m=0. So {u_1,...,u_n,...,u_m} are linearly dependent. # # Exercise 3.6 Prob 16,32,46. # Prob 16. # If v1,v2,v3,v4 are linearly independent and they span the space R(4), then they form a basis. # First let's see whether they span the space. for any vector v (a,b,c,d) in R(4), if we find v=c1*v1+c2*v2+c3*v3+c4*v4, # then given vectors span the v.s. # > A := matrix (4,4,[1,0,0,1,1,1,0,0,0,1,1,0,0,0,1,1]); [ 1 0 0 1 ] [ ] [ 1 1 0 0 ] A := [ ] [ 0 1 1 0 ] [ ] [ 0 0 1 1 ] > C := matrix (4,1,[a,b,c,d]); [ a ] [ ] [ b ] C := [ ] [ c ] [ ] [ d ] > linsolve(A, vector([a,b,c,d])); -------------------------------------------------------------------------------- > linsolve ( A, C); -------------------------------------------------------------------------------- > xref(A); [ 1 0 0 1 ] [ ] [ 0 1 0 -1 ] [ ] [ 0 0 1 1 ] [ ] [ 0 0 0 0 ] # This linear system is not soluable, which means we can't find the corresponding c1,c2,c3,c4 for any vector V[a,b,c,d], # neither are those four vecors linearly independent, so the given vectors do not form a basis for the given ventor space. # # # Prob. 32. Find a basis for, and the dimension of , the null space of the given matrix. # -------------------------------------------------------------------------------- > A := matrix ( 4,3,[1,1,1,2,3,-2,-1,0,-5,5,6,1]); [ 1 1 1 ] [ ] [ 2 3 -2 ] A := [ ] [ -1 0 -5 ] [ ] [ 5 6 1 ] > v := matrix (4,1,[0,0,0,0]); [ 0 ] [ ] [ 0 ] v := [ ] [ 0 ] [ ] [ 0 ] > NS(A) := linsolve(A, v); [ - 5 _t[1] ] [ ] NS(A) := [ 4 _t[1] ] [ ] [ _t[1] ] # the dimenion of the NS(A) is 1. # -------------------------------------------------------------------------------- # # Prob 42. # > v1 := vector([1,2,0]); v1 := [ 1, 2, 0 ] > v2 := vector([2,4,0]); v2 := [ 2, 4, 0 ] > v3 := vector([3,5,1]); v3 := [ 3, 5, 1 ] > v4 := vector([6,10,3]); v4 := [ 6, 10, 3 ] # Since v2 = 2* v1, so each of the set {v1,v3,v4} or {v2,v3,v4} is a basis for R2. # > e1 := vector ([ 1,0,0,0]); e1 := [ 1, 0, 0, 0 ] > e2 := vector([0,1,0,0]); e2 := [ 0, 1, 0, 0 ] > e3 := vector([0,0,1,0]); e3 := [ 0, 0, 1, 0 ] > e4 := vector([0,0,0,1]); e4 := [ 0, 0, 0, 1 ] > A1 := matrix(4,4,[1,2,0,1,2,4,0,0,3,5,1,0,6,10,3,0]); [ 1 2 0 1 ] [ ] [ 2 4 0 0 ] A1 := [ ] [ 3 5 1 0 ] [ ] [ 6 10 3 0 ] > xref(A1,4); [ 1 2 0 1 ] [ ] [ 0 -1 1 -3 ] [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 -2 ] > A2 := matrix(4,4,[1,2,0,0,2,4,0,1,3,5,1,0,6,10,3,0]); [ 1 2 0 0 ] [ ] [ 2 4 0 1 ] A2 := [ ] [ 3 5 1 0 ] [ ] [ 6 10 3 0 ] > xref(A2,4); [ 1 2 0 0 ] [ ] [ 0 -1 1 0 ] [ ] [ 0 0 1 0 ] [ ] [ 0 0 0 1 ] > A3 := matrix(4,4,[1,2,0,0,2,4,0,0,3,5,1,1,6,10,3,0]); [ 1 2 0 0 ] [ ] [ 2 4 0 0 ] A3 := [ ] [ 3 5 1 1 ] [ ] [ 6 10 3 0 ] > xref(A3,4); [ 1 2 0 0 ] [ ] [ 0 -1 1 1 ] [ ] [ 0 0 1 -2 ] [ ] [ 0 0 0 0 ] > A4 := matrix(4,4,[1,2,0,0,2,4,0,0,3,5,1,0,6,10,3,1]); [ 1 2 0 0 ] [ ] [ 2 4 0 0 ] A4 := [ ] [ 3 5 1 0 ] [ ] [ 6 10 3 1 ] > xref(A4,4); [ 1 2 0 0 ] [ ] [ 0 -1 1 0 ] [ ] [ 0 0 1 1 ] [ ] [ 0 0 0 0 ] # The sets {r1,r2,r3,e1} and {r1,r2,r3,e2} are linearly independent, so each set is a basis for R4.
processing. 2. Verilog (Computer hardware description lang

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote