<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2025-05-16</periodOfReport>

    <issuer>
        <issuerCik>0000021535</issuerCik>
        <issuerName>COHU INC</issuerName>
        <issuerTradingSymbol>COHU</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001578706</rptOwnerCik>
            <rptOwnerName>Mattes Andreas W</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>12367 CROSTHWAITE CIRCLE</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>POWAY</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>92064</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Restricted Stock Units</value>
            </securityTitle>
            <transactionDate>
                <value>2025-05-16</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>10257</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>22236</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Each Restricted Stock Unit (RSU) represents a contingent right to receive one share of Cohu, Inc. Common Stock upon vesting. The RSUs vest on the earlier to occur of (i) the one-year anniversary of the date of grant or (ii) the next Cohu, Inc. Annual Meeting of Stockholders (assuming continued service on the Board of Directors).</footnote>
        <footnote id="F2">Number of shares includes 11,161 Restricted Stock Units (RSUs) that in the future will be converted on a one-for-one basis into shares of Cohu, Inc. Common Stock immediately upon the vesting date (assuming continued service on the Board of Directors).</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Jeffrey D. Jones, by Power of Attorney</signatureName>
        <signatureDate>2025-05-20</signatureDate>
    </ownerSignature>
</ownershipDocument>
