Giter Club home page Giter Club logo

Comments (6)

visionxyz avatar visionxyz commented on May 24, 2024 1

好像知道問題在哪裡了。

from 2017-computer-organization.

ianchen-tw avatar ianchen-tw commented on May 24, 2024

我沒有翻程式碼,不夠你ok就行了👌

from 2017-computer-organization.

visionxyz avatar visionxyz commented on May 24, 2024

感覺距離你上次push也太久了,應該你也忘記了。我現在用sum當less_out也能出來對的結果。他的bonus test case太少了。也看不出到底哪個寫法可能有錯。

from 2017-computer-organization.

ianchen-tw avatar ianchen-tw commented on May 24, 2024

@blessxu 你是在說Lab1吧! 這差不多兩年前的作業了 因為沒有寫文件所以我也忘記bonus_control 是什麼東西了QQ
Anyway 如果你有什麼疑問還是可以提出來,我會盡量幫你解答!

from 2017-computer-organization.

visionxyz avatar visionxyz commented on May 24, 2024

我來講一下吧,就是會有一個LST的set,需要解答 a是不是less than b。方法就是a-b,也就是a+b的2's complement,然後判斷正負。我看了看您這裡的code,最後less的值似乎用了cout來判斷,感覺bottom那邊的cout不能當做判斷的理由,sum才是正負的判斷bit。
https://github.com/ianre657/ComputerOrganization_2017Spring/blob/f6b445db44fa70f2ecdca4be1d492bf42d129bde/lab1/sourceCode/alu_bottom.v#L37
就是這裡。真的非常感謝了。

from 2017-computer-organization.

visionxyz avatar visionxyz commented on May 24, 2024

您這樣的寫法之所以答案是對的,是因為在compare裡面做了調整。
比如1000000000000000和1000000000000000比較SLT,如果根據cout來判斷的話,cout=1,less就是1。也就是less成立了,不過compare裡面居然還要求less的情況下不能equal(LT: out <= less & ~equal;),這其實是非常奇怪的要求,less成立怎麼還會equal呢。答案其實是會的,這段程式會在equal的情況下還判斷為less。不過有了這段矯正的code,所以最後的答案是對的。

from 2017-computer-organization.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.